mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
fix foreign key errors
This commit is contained in:
parent
d2fb6f341e
commit
4cab9b2f36
1 changed files with 13 additions and 13 deletions
26
setup.sql
26
setup.sql
|
@ -9,12 +9,18 @@ CREATE TABLE IF NOT EXISTS `contact_settings` (
|
||||||
`fetch` ENUM('always', 'once', 'never') DEFAULT 'once',
|
`fetch` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||||
`submit` ENUM('always', 'once', 'never') DEFAULT 'once',
|
`submit` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||||
`generation` ENUM('always', 'once', 'never') DEFAULT 'once',
|
`generation` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||||
`reply` ENUM('always', 'once', 'never') DEFAULT 'once'
|
`reply` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||||
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE
|
||||||
|
) ENGINE=INNODB;
|
||||||
|
CREATE TABLE IF NOT EXISTS `credentials` (
|
||||||
|
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
`client_id` VARCHAR(128) NOT NULL,
|
||||||
|
`client_secret` VARCHAR(128) NOT NULL,
|
||||||
|
`secret` VARCHAR(128) NOT NULL
|
||||||
) ENGINE=INNODB;
|
) ENGINE=INNODB;
|
||||||
CREATE TABLE IF NOT EXISTS `bots` (
|
CREATE TABLE IF NOT EXISTS `bots` (
|
||||||
`id` BINARY(64) PRIMARY KEY,
|
`id` BINARY(64) PRIMARY KEY,
|
||||||
`user_id` BINARY(64) PRIMARY KEY,
|
`user_id` BINARY(64) NOT NULL,
|
||||||
`credentials_id` INT NOT NULL,
|
`credentials_id` INT NOT NULL,
|
||||||
`enabled` BOOLEAN DEFAULT 1,
|
`enabled` BOOLEAN DEFAULT 1,
|
||||||
`replies_enabled` BOOLEAN DEFAULT 1,
|
`replies_enabled` BOOLEAN DEFAULT 1,
|
||||||
|
@ -31,12 +37,6 @@ CREATE TABLE IF NOT EXISTS `bots` (
|
||||||
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
||||||
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 `credentials` (
|
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
`client_id` VARCHAR(128) NOT NULL,
|
|
||||||
`client_secret` VARCHAR(128) NOT NULL,
|
|
||||||
`secret` VARCHAR(128) NOT NULL
|
|
||||||
) 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) NOT NULL PRIMARY KEY,
|
||||||
`outbox` VARCHAR(256),
|
`outbox` VARCHAR(256),
|
||||||
|
@ -55,14 +55,14 @@ CREATE TABLE IF NOT EXISTS `word_blacklist` (
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
`bot_id` BINARY(64) NOT NULL,
|
`bot_id` BINARY(64) NOT NULL,
|
||||||
`phrase` VARCHAR(128) NOT NULL,
|
`phrase` VARCHAR(128) NOT NULL,
|
||||||
`whole_word` BOOLEAN NOT NULL
|
`whole_word` BOOLEAN NOT NULL,
|
||||||
FOREIGN KEY (`bot_id`) REFERENCES bots(id) ON DELETE CASCADE,
|
FOREIGN KEY (`bot_id`) REFERENCES bots(id) ON DELETE CASCADE
|
||||||
) ENGINE=INNODB;
|
) ENGINE=INNODB;
|
||||||
CREATE TABLE IF NOT EXISTS `contact_history` (
|
CREATE TABLE IF NOT EXISTS `contact_history` (
|
||||||
`user_id` BINARY(64) NOT NULL,
|
`user_id` BINARY(64) NOT NULL,
|
||||||
`fetch` BOOLEAN DEFAULT 0,
|
`fetch` BOOLEAN DEFAULT 0,
|
||||||
`submit` BOOLEAN DEFAULT 0,
|
`submit` BOOLEAN DEFAULT 0,
|
||||||
`generation` BOOLEAN DEFAULT 0,
|
`generation` BOOLEAN DEFAULT 0,
|
||||||
`reply` BOOLEAN DEFAULT 0
|
`reply` BOOLEAN DEFAULT 0,
|
||||||
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE
|
||||||
) ENGINE=INNODB;
|
) ENGINE=INNODB;
|
||||||
|
|
Loading…
Reference in a new issue