Skip to content

Commit 713bddd

Browse files
committed
add delete from terms
1 parent 3f6ef83 commit 713bddd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-- +goose Up
22
-- +goose StatementBegin
3+
DELETE FROM terms WHERE allocation_id NOT IN (SELECT id FROM allocations);
34
ALTER TABLE ONLY terms DROP CONSTRAINT fk_terms_allocation;
45
ALTER TABLE ONLY terms ADD CONSTRAINT fk_terms_allocation foreign key (allocation_id) references allocations(id) ON DELETE CASCADE;
5-
CREATE INDEX idx_terms_allocation_id ON terms USING btree(allocation_id);
6+
CREATE INDEX idx_terms_allocation_id ON terms USING HASH(allocation_id);
67
-- +goose StatementEnd

0 commit comments

Comments
 (0)