Skip to content

Commit

Permalink
feat: update migration to create resources_exceptions table
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Aug 27, 2024
1 parent 51337ce commit 640beee
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-- add resources_exceptions table

-- create a table with a resource_id column as foreign key to resources.id
-- create a table with a unique resource_id column as foreign key to resources.id, and a indexes column to list the the table indexes to be created
CREATE TABLE resources_exceptions (
id SERIAL PRIMARY KEY,
resource_id INT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (resource_id) REFERENCES catalog(id)
resource_id UUID UNIQUE NOT NULL REFERENCES catalog(resource_id) ON DELETE CASCADE,
indexes JSONB DEFAULT '[]'::JSONB,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

--- Add rows to the resources_exceptions table
INSERT INTO resources_exceptions (resource_id) VALUES ('f868cca6-8da1-4369-a78d-47463f19a9a3'), ('4babf5f2-6a9c-45b5-9144-ca5eae6a7a6d');

0 comments on commit 640beee

Please sign in to comment.