mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
add FK for posts table referencing fedi table
This commit is contained in:
parent
86f68cfa37
commit
6b24fb667b
1 changed files with 4 additions and 2 deletions
|
@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS `bots` (
|
||||||
FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE
|
FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE
|
||||||
) ENGINE=INNODB;
|
) ENGINE=INNODB;
|
||||||
CREATE TABLE IF NOT EXISTS `fedi_account` (
|
CREATE TABLE IF NOT EXISTS `fedi_account` (
|
||||||
`handle` VARCHAR(128) NOT NULL PRIMARY KEY,
|
`handle` VARCHAR(128) PRIMARY KEY,
|
||||||
`outbox` VARCHAR(256),
|
`outbox` VARCHAR(256),
|
||||||
`credentials_id` INT NOT NULL,
|
`credentials_id` INT NOT NULL,
|
||||||
`icon` VARCHAR(512),
|
`icon` VARCHAR(512),
|
||||||
|
@ -43,9 +43,11 @@ CREATE TABLE IF NOT EXISTS `fedi_account` (
|
||||||
) ENGINE=INNODB;
|
) ENGINE=INNODB;
|
||||||
CREATE TABLE IF NOT EXISTS `posts` (
|
CREATE TABLE IF NOT EXISTS `posts` (
|
||||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
`id` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
`fedi_id` VARCHAR(128),
|
||||||
`post_id` VARCHAR(64) NOT NULL,
|
`post_id` VARCHAR(64) NOT NULL,
|
||||||
`content` TEXT 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;
|
) ENGINE=INNODB;
|
||||||
CREATE TABLE IF NOT EXISTS `word_blacklist` (
|
CREATE TABLE IF NOT EXISTS `word_blacklist` (
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
|
Loading…
Reference in a new issue