Skip to content
Snippets Groups Projects

Draft: PoC for removing partitioned data using foreign keys

Closed Marius Bobin requested to merge 358943-fk-data-removal-poc into master
5 unresolved threads
1 file
+ 6
0
Compare changes
  • Side-by-side
  • Inline
@@ -35,6 +35,12 @@ def up
REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT
EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
SQL
execute <<~SQL
ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id, partition_id)
REFERENCES p_ci_pipelines(id, partition_id) ON DELETE CASCADE;
SQL
end
def down
Loading