We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f6ef83 commit 713bdddCopy full SHA for 713bddd
goose/migrations/1718355236_terms_index.sql
@@ -1,6 +1,7 @@
1
-- +goose Up
2
-- +goose StatementBegin
3
+DELETE FROM terms WHERE allocation_id NOT IN (SELECT id FROM allocations);
4
ALTER TABLE ONLY terms DROP CONSTRAINT fk_terms_allocation;
5
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);
6
+CREATE INDEX idx_terms_allocation_id ON terms USING HASH(allocation_id);
7
-- +goose StatementEnd
0 commit comments