Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1251] Delete ResourceViews when purging their Resource
- Loading branch information
1 parent
7a101cb
commit 6b50e02
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
ckan/migration/versions/073_update_resource_view_resource_id_constraint.py
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def upgrade(migrate_engine): | ||
migrate_engine.execute(''' | ||
ALTER TABLE resource_view | ||
DROP CONSTRAINT resource_view_resource_id_fkey; | ||
ALTER TABLE resource_view | ||
ADD CONSTRAINT resource_view_resource_id_fkey | ||
FOREIGN KEY (resource_id) REFERENCES resource(id) | ||
ON UPDATE CASCADE ON DELETE CASCADE; | ||
''') |
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