bin_id INT4 NOT NULL REFERENCES binaries(id) ON DELETE CASCADE,
src_id INT4 NOT NULL REFERENCES source(id) ON DELETE RESTRICT,
- UNIQUE (bin_id, src_id)
+ PRIMARY KEY (bin_id, src_id)
)""")
c.execute("UPDATE config SET value = '45' WHERE name = 'db_revision'")
c.execute("""
CREATE TABLE metadata_keys (
key_id SERIAL NOT NULL UNIQUE,
- key TEXT NOT NULL UNIQUE
+ key TEXT NOT NULL UNIQUE,
+
+ PRIMARY KEY (key_id)
)
""")
bin_id INT4 NOT NULL REFERENCES binaries(id) ON DELETE CASCADE,
key_id INT4 NOT NULL REFERENCES metadata_keys(key_id),
value TEXT NOT NULL,
- UNIQUE (bin_id, key_id)
+
+ PRIMARY KEY (bin_id, key_id)
)
""")
src_id INT4 NOT NULL REFERENCES source(id) ON DELETE CASCADE,
key_id INT4 NOT NULL REFERENCES metadata_keys(key_id),
value TEXT NOT NULL,
- UNIQUE (src_id, key_id)
+
+ PRIMARY KEY (src_id, key_id)
)
""")