DB: Removed explicit collation values on tables for compatability reasons

This commit is contained in:
Taso committed 2021-01-12 21:27:37 -05:00
1 parent c91d0729fb
commit c9b3174505
1 file changed
+18 -20
+18 -20
View File
@@ -14,9 +14,7 @@ CREATE TABLE IF NOT EXISTS npwd_phone_contacts (
) )
ENGINE = INNODB, ENGINE = INNODB,
AUTO_INCREMENT = 6, AUTO_INCREMENT = 6,
AVG_ROW_LENGTH = 4096, AVG_ROW_LENGTH = 4096;
CHARACTER SET utf8mb4,
COLLATE utf8mb4_0900_ai_ci;
CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` ( CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
@@ -24,26 +22,26 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`likes` int NOT NULL DEFAULT '0', `likes` int NOT NULL DEFAULT '0',
`identifier` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `identifier` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`visible` tinyint NOT NULL DEFAULT '1', `visible` tinyint NOT NULL DEFAULT '1',
`images` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '', `images` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=190 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=19;
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` ( CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`profile_name` varchar(90) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `profile_name` varchar(90) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`identifier` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `identifier` varchar(40) NOT NULL,
`avatar_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, `avatar_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bio` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, `bio` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`location` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, `location` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`job` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, `job` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `profile_name_UNIQUE` (`profile_name`) UNIQUE KEY `profile_name_UNIQUE` (`profile_name`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=15;
CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` ( CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
@@ -55,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
KEY `tweet_idx` (`tweet_id`), KEY `tweet_idx` (`tweet_id`),
CONSTRAINT `profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`), CONSTRAINT `profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`),
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=41;
CREATE TABLE IF NOT EXISTS npwd_notes ( CREATE TABLE IF NOT EXISTS npwd_notes (
@@ -67,9 +65,7 @@ CREATE TABLE IF NOT EXISTS npwd_notes (
) )
ENGINE = INNODB, ENGINE = INNODB,
AUTO_INCREMENT = 5, AUTO_INCREMENT = 5,
AVG_ROW_LENGTH = 4096, AVG_ROW_LENGTH = 4096;
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS npwd_sellout_listings ( CREATE TABLE IF NOT EXISTS npwd_sellout_listings (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
@@ -97,7 +93,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
KEY `tweet_idx` (`tweet_id`), KEY `tweet_idx` (`tweet_id`),
CONSTRAINT `report_profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`), CONSTRAINT `report_profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`),
CONSTRAINT `report_tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE CONSTRAINT `report_tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=45;
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` ( CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
@@ -112,9 +108,11 @@ CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
KEY `npwd_messages_groups_group_id` (`group_id`), KEY `npwd_messages_groups_group_id` (`group_id`),
KEY `npwd_messages_groups_user_identifier_idx` (`user_identifier`), KEY `npwd_messages_groups_user_identifier_idx` (`user_identifier`),
KEY `npwd_messages_groups_participant_identifier_idx` (`participant_identifier`), KEY `npwd_messages_groups_participant_identifier_idx` (`participant_identifier`),
# This table is erroring out because of default collation and charset values on the `user` table
# We should discuss an adequate solution
CONSTRAINT `npwd_messages_groups_participant_identifier` FOREIGN KEY (`participant_identifier`) REFERENCES `users` (`identifier`), CONSTRAINT `npwd_messages_groups_participant_identifier` FOREIGN KEY (`participant_identifier`) REFERENCES `users` (`identifier`),
CONSTRAINT `npwd_messages_groups_user_identifier` FOREIGN KEY (`user_identifier`) REFERENCES `users` (`identifier`) CONSTRAINT `npwd_messages_groups_user_identifier` FOREIGN KEY (`user_identifier`) REFERENCES `users` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=66;
CREATE TABLE IF NOT EXISTS `npwd_messages_labels` ( CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
@@ -127,7 +125,7 @@ CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
KEY `npwd_messages_labels_group_id_idx` (`group_id`), KEY `npwd_messages_labels_group_id_idx` (`group_id`),
KEY `npwd_messages_labels_group_id_idx1` (`user_identifier`), KEY `npwd_messages_labels_group_id_idx1` (`user_identifier`),
CONSTRAINT `npwd_messages_labels_group_id` FOREIGN KEY (`group_id`) REFERENCES `npwd_messages_groups` (`group_id`) CONSTRAINT `npwd_messages_labels_group_id` FOREIGN KEY (`group_id`) REFERENCES `npwd_messages_groups` (`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; );
CREATE TABLE IF NOT EXISTS `npwd_messages` ( CREATE TABLE IF NOT EXISTS `npwd_messages` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
@@ -143,4 +141,4 @@ CREATE TABLE IF NOT EXISTS `npwd_messages` (
KEY `npwd_messages_group_id_idx` (`group_id`), KEY `npwd_messages_group_id_idx` (`group_id`),
CONSTRAINT `npwd_messages_group_id` FOREIGN KEY (`group_id`) REFERENCES `npwd_messages_groups` (`group_id`), CONSTRAINT `npwd_messages_group_id` FOREIGN KEY (`group_id`) REFERENCES `npwd_messages_groups` (`group_id`),
CONSTRAINT `npwd_messages_user_identifier` FOREIGN KEY (`user_identifier`) REFERENCES `users` (`identifier`) CONSTRAINT `npwd_messages_user_identifier` FOREIGN KEY (`user_identifier`) REFERENCES `users` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; );