rssguard/resources/sql/db_update_mysql_15_16.sql
2020-10-25 14:04:20 +01:00

21 lines
708 B
SQL

USE ##;
-- !
CREATE TABLE IF NOT EXISTS Labels (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL CHECK (name != ''),
color VARCHAR(7),
custom_id TEXT,
account_id INTEGER NOT NULL,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
-- !
CREATE TABLE IF NOT EXISTS LabelsInMessages (
label TEXT NOT NULL, /* Custom ID of label. */
message TEXT NOT NULL, /* Custom ID of message. */
account_id INTEGER NOT NULL,
FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE
);
-- !
UPDATE Information SET inf_value = '16' WHERE inf_key = 'schema_version';