-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update migration to create resources_exceptions table
- Loading branch information
1 parent
51337ce
commit 640beee
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 7 additions & 4 deletions
11
udata_hydra/migrations/main/20240827_add_resources_exceptions_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |