CREATE TABLE `seadex_state` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` bigint(20) NOT NULL, `anilist_id` int(10) unsigned NOT NULL, `anime_name` varchar(255) NOT NULL, `last_updated` varchar(40) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `uq_user_anilist` (`user_id`,`anilist_id`), CONSTRAINT `fk_seadex_state_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE )