update tables
This commit is contained in:
@ -11,9 +11,11 @@ ALTER TABLE omnivore.labels
|
||||
ADD CONSTRAINT label_name_unique UNIQUE (user_id, name);
|
||||
|
||||
CREATE TABLE omnivore.link_labels (
|
||||
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
|
||||
link_id uuid NOT NULL REFERENCES omnivore.links ON DELETE CASCADE,
|
||||
label_id uuid NOT NULL REFERENCES omnivore.labels ON DELETE CASCADE,
|
||||
created_at timestamptz NOT NULL DEFAULT current_timestamp
|
||||
created_at timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
UNIQUE (link_id, label_id)
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
@ -8,7 +8,7 @@ ALTER TABLE omnivore.labels
|
||||
ADD COLUMN link_id uuid REFERENCES omnivore.links ON DELETE CASCADE,
|
||||
DROP COLUMN color,
|
||||
DROP COLUMN description,
|
||||
DROP CONSTRAINT label_name;
|
||||
DROP CONSTRAINT label_name_unique;
|
||||
|
||||
DROP TABLE omnivore.link_labels;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user