More complete SQL stuff for #102.
This commit is contained in:
parent
e9a0b62e27
commit
a4e2240e05
@ -113,5 +113,16 @@ CREATE TABLE IF NOT EXISTS Labels (
|
||||
custom_id TEXT,
|
||||
custom_hash TEXT,
|
||||
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
DROP TABLE IF EXISTS LabelsInMessages;
|
||||
-- !
|
||||
CREATE TABLE IF NOT EXISTS LabelsInMessages (
|
||||
id INTEGER AUTO_INCREMENT PRIMARY KEY,
|
||||
message_custom_id TEXT NOT NULL,
|
||||
label_custom_id TEXT NOT NULL,
|
||||
account_id INTEGER NOT NULL,
|
||||
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
@ -108,5 +108,18 @@ CREATE TABLE IF NOT EXISTS Labels (
|
||||
custom_id TEXT,
|
||||
custom_hash TEXT,
|
||||
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
DROP TABLE IF EXISTS LabelsInMessages;
|
||||
-- !
|
||||
CREATE TABLE IF NOT EXISTS LabelsInMessages (
|
||||
id INTEGER PRIMARY KEY,
|
||||
message_custom_id TEXT NOT NULL,
|
||||
label_custom_id TEXT NOT NULL,
|
||||
account_id INTEGER NOT NULL,
|
||||
|
||||
FOREIGN KEY (message_custom_id) REFERENCES Messages (custom_id),
|
||||
FOREIGN KEY (label_custom_id) REFERENCES Labels (custom_id),
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
@ -11,4 +11,13 @@ CREATE TABLE IF NOT EXISTS Labels (
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
CREATE TABLE IF NOT EXISTS LabelsInMessages (
|
||||
id INTEGER AUTO_INCREMENT PRIMARY KEY,
|
||||
message_custom_id TEXT NOT NULL,
|
||||
label_custom_id TEXT NOT NULL,
|
||||
account_id INTEGER NOT NULL,
|
||||
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
UPDATE Information SET inf_value = '8' WHERE inf_key = 'schema_version';
|
@ -11,4 +11,15 @@ CREATE TABLE IF NOT EXISTS Labels (
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
CREATE TABLE IF NOT EXISTS LabelsInMessages (
|
||||
id INTEGER PRIMARY KEY,
|
||||
message_custom_id TEXT NOT NULL,
|
||||
label_custom_id TEXT NOT NULL,
|
||||
account_id INTEGER NOT NULL,
|
||||
|
||||
FOREIGN KEY (message_custom_id) REFERENCES Messages (custom_id),
|
||||
FOREIGN KEY (label_custom_id) REFERENCES Labels (custom_id),
|
||||
FOREIGN KEY (account_id) REFERENCES Accounts (id)
|
||||
);
|
||||
-- !
|
||||
UPDATE Information SET inf_value = '8' WHERE inf_key = 'schema_version';
|
Loading…
x
Reference in New Issue
Block a user