1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-12-28 07:18:59 +00:00

add FK for posts table referencing fedi table

This commit is contained in:
Lynne Megido 2019-09-01 20:01:27 +10:00
parent 86f68cfa37
commit 6b24fb667b

View file

@ -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,