Skip to content

Commit

Permalink
add delete from terms
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitenjain14 committed Jun 14, 2024
1 parent 3f6ef83 commit 713bddd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion goose/migrations/1718355236_terms_index.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- +goose Up
-- +goose StatementBegin
DELETE FROM terms WHERE allocation_id NOT IN (SELECT id FROM allocations);
ALTER TABLE ONLY terms DROP CONSTRAINT fk_terms_allocation;
ALTER TABLE ONLY terms ADD CONSTRAINT fk_terms_allocation foreign key (allocation_id) references allocations(id) ON DELETE CASCADE;
CREATE INDEX idx_terms_allocation_id ON terms USING btree(allocation_id);
CREATE INDEX idx_terms_allocation_id ON terms USING HASH(allocation_id);
-- +goose StatementEnd

0 comments on commit 713bddd

Please sign in to comment.