aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/tables.sql
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-11 13:33:06 +0200
committerWojtek Kosior <koszko@koszko.org>2022-08-11 13:33:06 +0200
commit67c58a14f4f356117f42fea368a32359496d46c4 (patch)
treebb8d1019dc4547a215404a40b60a031ca4f2e21d /src/hydrilla/proxy/tables.sql
parent3f3ba519ae3c3346945928b21ab36f7238e5387e (diff)
downloadhaketilo-hydrilla-67c58a14f4f356117f42fea368a32359496d46c4.tar.gz
haketilo-hydrilla-67c58a14f4f356117f42fea368a32359496d46c4.zip
populate data structures based on payloads data loaded from sqlite db
Diffstat (limited to 'src/hydrilla/proxy/tables.sql')
-rw-r--r--src/hydrilla/proxy/tables.sql7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/hydrilla/proxy/tables.sql b/src/hydrilla/proxy/tables.sql
index 25493d3..2a6cac6 100644
--- a/src/hydrilla/proxy/tables.sql
+++ b/src/hydrilla/proxy/tables.sql
@@ -121,15 +121,11 @@ CREATE TABLE mapping_statuses(
-- "enabled" determines whether mapping's status is ENABLED,
-- DISABLED or NO_MARK.
enabled CHAR(1) NOT NULL,
- enabled_version_id INTEGER NULL,
-- "frozen" determines whether an enabled mapping is to be kept in its
-- EXACT_VERSION, is to be updated only with versions from the same
-- REPOSITORY or is NOT_FROZEN at all.
frozen CHAR(1) NULL,
- CHECK (NOT (enabled = 'D' AND enabled_version_id IS NOT NULL)),
- CHECK (NOT (enabled = 'E' AND enabled_version_id IS NULL)),
-
CHECK ((frozen IS NULL) = (enabled != 'E')),
CHECK (frozen IS NULL OR frozen in ('E', 'R', 'N'))
);
@@ -143,8 +139,6 @@ CREATE TABLE item_versions(
definition TEXT NOT NULL,
UNIQUE (item_id, version, repo_iteration_id),
- -- Allow foreign key from "mapping_statuses".
- UNIQUE (item_version_id, item_id),
FOREIGN KEY (item_id)
REFERENCES items (item_id),
@@ -226,6 +220,7 @@ CREATE TABLE file_uses(
CHECK (type IN ('L', 'W')),
UNIQUE(item_version_id, type, idx),
+ UNIQUE(item_version_id, type, name),
FOREIGN KEY (item_version_id)
REFERENCES item_versions(item_version_id)