File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
migrations/20170308191449_crate_owners_does_not_need_id Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ ALTER TABLE crate_owners DROP CONSTRAINT crate_owners_pkey;
2+ ALTER TABLE crate_owners ADD CONSTRAINT crate_owners_unique_owner_per_crate UNIQUE (crate_id, owner_id, owner_kind);
3+ ALTER TABLE crate_owners ADD COLUMN id SERIAL PRIMARY KEY ;
4+ CREATE INDEX index_crate_owners_crate_id ON crate_owners (crate_id);
5+ DROP INDEX crate_owners_not_deleted;
Original file line number Diff line number Diff line change 1+ ALTER TABLE crate_owners DROP COLUMN id;
2+ ALTER TABLE crate_owners DROP CONSTRAINT crate_owners_unique_owner_per_crate;
3+ ALTER TABLE crate_owners ADD PRIMARY KEY (crate_id, owner_id, owner_kind);
4+ DROP INDEX index_crate_owners_crate_id;
5+ CREATE UNIQUE INDEX crate_owners_not_deleted ON crate_owners (crate_id, owner_id, owner_kind) WHERE NOT deleted;
Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ table! {
3030}
3131
3232table ! {
33- crate_owners ( id) {
34- id -> Int4 ,
33+ crate_owners ( crate_id, owner_id, owner_kind) {
3534 crate_id -> Int4 ,
3635 owner_id -> Int4 ,
3736 created_at -> Timestamp ,
You can’t perform that action at this time.
0 commit comments