From a5d775d5e7ddf810d96e822127d8429d86c1d504 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 2 Sep 2019 15:55:51 +1000 Subject: [PATCH] reduce size of bot id column --- setup.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sql b/setup.sql index 87c4873..a40c3f4 100644 --- a/setup.sql +++ b/setup.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS `credentials` ( `secret` VARCHAR(128) NOT NULL ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `bots` ( - `id` BINARY(64) PRIMARY KEY, + `id` BINARY(32) PRIMARY KEY, `user_id` INT NOT NULL, `credentials_id` INT NOT NULL, `handle` VARCHAR(128) NOT NULL, @@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `fedi_accounts` ( FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `bot_learned_accounts` ( - `bot_id` BINARY(64) NOT NULL, + `bot_id` BINARY(32) NOT NULL, `fedi_id` VARCHAR(128) NOT NULL, FOREIGN KEY (`bot_id`) REFERENCES bots(id) ON DELETE CASCADE, FOREIGN KEY (`fedi_id`) REFERENCES fedi_accounts(handle) ON DELETE CASCADE @@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS `posts` ( ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `word_blacklist` ( `id` INT AUTO_INCREMENT PRIMARY KEY, - `bot_id` BINARY(64) NOT NULL, + `bot_id` BINARY(32) NOT NULL, `phrase` VARCHAR(128) NOT NULL, `whole_word` BOOLEAN NOT NULL, FOREIGN KEY (`bot_id`) REFERENCES bots(id) ON DELETE CASCADE