diff --git a/setup.sql b/setup.sql index b16da27..48b8718 100644 --- a/setup.sql +++ b/setup.sql @@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS `bots` ( FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `fedi_account` ( - `handle` VARCHAR(128) NOT NULL PRIMARY KEY, + `handle` VARCHAR(128) PRIMARY KEY, `outbox` VARCHAR(256), `credentials_id` INT NOT NULL, `icon` VARCHAR(512), @@ -43,9 +43,11 @@ CREATE TABLE IF NOT EXISTS `fedi_account` ( ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `posts` ( `id` BIGINT AUTO_INCREMENT PRIMARY KEY, + `fedi_id` VARCHAR(128), `post_id` VARCHAR(64) NOT NULL, `content` TEXT NOT NULL, - `cw` BOOLEAN NOT NULL + `cw` BOOLEAN NOT NULL, + FOREIGN KEY (`fedi_id`) REFERENCES fedi_account(handle) ON DELETE CASCADE; ) ENGINE=INNODB; CREATE TABLE IF NOT EXISTS `word_blacklist` ( `id` INT AUTO_INCREMENT PRIMARY KEY,