CREATE TABLE IF NOT EXISTS `twitter_accounts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '0', `password` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '0', `avatar_url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; CREATE TABLE IF NOT EXISTS `twitter_tweets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `authorId` int(11) NOT NULL, `realUser` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `message` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL, `time` timestamp NOT NULL DEFAULT current_timestamp(), `likes` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `FK_twitter_tweets_twitter_accounts` (`authorId`), CONSTRAINT `FK_twitter_tweets_twitter_accounts` FOREIGN KEY (`authorId`) REFERENCES `twitter_accounts` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `twitter_likes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `authorId` int(11) DEFAULT NULL, `tweetId` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK_twitter_likes_twitter_accounts` (`authorId`), KEY `FK_twitter_likes_twitter_tweets` (`tweetId`), CONSTRAINT `FK_twitter_likes_twitter_accounts` FOREIGN KEY (`authorId`) REFERENCES `twitter_accounts` (`id`), CONSTRAINT `FK_twitter_likes_twitter_tweets` FOREIGN KEY (`tweetId`) REFERENCES `twitter_tweets` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;