Created
August 28, 2016 09:49
-
-
Save gentoo90/f4a6527295dd7514a678cd9de1cffa6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- sqlite_master.sql 2016-08-28 10:01:23.227790106 +0300 | |
+++ sqlite_named_enums.sql 2016-08-28 09:26:14.223932432 +0300 | |
@@ -60,7 +60,7 @@ | |
build_id INTEGER NOT NULL, | |
url VARCHAR(2048), | |
PRIMARY KEY (id), | |
- CHECK (status IN ('bad', 'receiving', 'reviewing', 'processing', 'good')), | |
+ CONSTRAINT release_states CHECK (status IN ('bad', 'receiving', 'reviewing', 'processing', 'good')), | |
FOREIGN KEY(build_id) REFERENCES build (id) | |
); | |
CREATE TABLE build_ownership ( | |
@@ -89,7 +89,7 @@ | |
distortion FLOAT, | |
PRIMARY KEY (id), | |
FOREIGN KEY(release_id) REFERENCES release (id), | |
- CHECK (status IN ('diff_approved', 'no_diff_needed', 'data_pending', 'failed', 'diff_not_found', 'needs_diff', 'diff_found')), | |
+ CONSTRAINT run_states CHECK (status IN ('diff_approved', 'no_diff_needed', 'data_pending', 'failed', 'diff_not_found', 'needs_diff', 'diff_found')), | |
FOREIGN KEY(image) REFERENCES artifact (id), | |
FOREIGN KEY(log) REFERENCES artifact (id), | |
FOREIGN KEY(config) REFERENCES artifact (id), | |
@@ -118,7 +118,7 @@ | |
payload BLOB, | |
content_type VARCHAR(100), | |
PRIMARY KEY (task_id, queue_name), | |
- CHECK (status IN ('canceled', 'live', 'done', 'error')), | |
+ CONSTRAINT work_queue_states CHECK (status IN ('canceled', 'live', 'done', 'error')), | |
FOREIGN KEY(build_id) REFERENCES build (id), | |
FOREIGN KEY(release_id) REFERENCES release (id), | |
FOREIGN KEY(run_id) REFERENCES run (id) | |
@@ -137,7 +137,7 @@ | |
FOREIGN KEY(release_id) REFERENCES release (id), | |
FOREIGN KEY(run_id) REFERENCES run (id), | |
FOREIGN KEY(user_id) REFERENCES user (id), | |
- CHECK (log_type IN ('run_rejected', 'revoked_admin', 'changed_settings', 'release_bad', 'release_good', 'created_api_key', 'revoked_api_key', 'invite_accepted', 'invited_new_admin', 'created_build', 'release_reviewing', 'run_approved')) | |
+ CONSTRAINT log_types CHECK (log_type IN ('run_rejected', 'revoked_admin', 'changed_settings', 'release_bad', 'release_good', 'created_api_key', 'revoked_api_key', 'invite_accepted', 'invited_new_admin', 'created_build', 'release_reviewing', 'run_approved')) | |
); | |
CREATE INDEX created_index ON work_queue (queue_name, status, created); | |
CREATE INDEX reap_index ON work_queue (status, created); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment