diff --git a/database.sql b/database.sql index 3885ed0..923876d 100644 --- a/database.sql +++ b/database.sql @@ -12,15 +12,15 @@ CREATE TABLE `seadex_state` ( ) CREATE TABLE `seadex_state_subscriptions` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint(20) NOT NULL, - `seadex_state_id` int(10) unsigned NOT NULL, - `anime_name` varchar(255) NOT NULL, + `id` int unsigned NOT NULL AUTO_INCREMENT, + `user_id` bigint NOT NULL, + `seadex_state_id` int unsigned NOT NULL, + `custom_name` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `uq_user_state` (`user_id`,`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 +); \ No newline at end of file