Feature/subscription table #2

Merged
florian merged 7 commits from feature/subscription-table into main 2026-11-04 17:44:50 +00:00
Showing only changes of commit b1976d1c97 - Show all commits
+7 -7
View File
@@ -12,15 +12,15 @@ CREATE TABLE `seadex_state` (
) )
CREATE TABLE `seadex_state_subscriptions` ( CREATE TABLE `seadex_state_subscriptions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL, `user_id` bigint NOT NULL,
`seadex_state_id` int(10) unsigned NOT NULL, `seadex_state_id` int unsigned NOT NULL,
`anime_name` varchar(255) NOT NULL, `custom_name` varchar(255) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '1',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `uq_user_state` (`user_id`,`seadex_state_id`), UNIQUE KEY `uq_user_state` (`user_id`,`seadex_state_id`),
KEY `idx_subscriptions_state` (`seadex_state_id`), KEY `idx_subscriptions_state` (`seadex_state_id`),
CONSTRAINT `fk_subscriptions_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE, CONSTRAINT `fk_subscriptions_state` FOREIGN KEY (`seadex_state_id`) REFERENCES `seadex_state` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_subscriptions_state` FOREIGN KEY (`seadex_state_id`) REFERENCES `seadex_state` (`id`) ON DELETE CASCADE CONSTRAINT `fk_subscriptions_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE
); );