aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 18:11:56 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 18:11:56 -0700
commit69e9497686a05c8b27d5496e5ff66664c785c25b (patch)
tree6742da072fb1e6a94e82258a2a06dd78f58b8a93
parent3dad2832c8d481bff03fd4f2e6baa9f76ed0f588 (diff)
downloadfatcat-69e9497686a05c8b27d5496e5ff66664c785c25b.tar.gz
fatcat-69e9497686a05c8b27d5496e5ff66664c785c25b.zip
set correct primary keys on many-to-many tables
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index 7d236f80..a517d788 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -189,15 +189,15 @@ CREATE TABLE release_contrib (
);
CREATE TABLE release_ref (
- id BIGSERIAL PRIMARY KEY,
release_rev BIGSERIAL REFERENCES release_rev(id) NOT NULL,
target_release_ident_id UUID REFERENCES creator_ident(id),
index INTEGER,
stub TEXT
+ PRIMARY KEY (release_rev, target_release_ident_id)
);
CREATE TABLE file_release (
- id BIGSERIAL PRIMARY KEY,
file_rev BIGSERIAL REFERENCES file_rev(id) NOT NULL,
- target_release_ident_id UUID REFERENCES creator_ident(id) NOT NULL
+ target_release_ident_id UUID REFERENCES creator_ident(id) NOT NULL,
+ PRIMARY KEY (file_rev, target_release_ident_id)
);