Skip to content

Commit

Permalink
Fix down migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
piohei committed Oct 14, 2024
1 parent 9a283f9 commit 7ec6199
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions schemas/database/015_add_constraints_for_identities.down.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DROP UNIQUE INDEX idx_unique_insertion_leaf;
DROP UNIQUE INDEX idx_unique_deletion_leaf;
DROP INDEX idx_unique_insertion_leaf;
DROP INDEX idx_unique_deletion_leaf;

DROP TRIGGER validate_pre_root_trigger;
DROP TRIGGER validate_pre_root_trigger ON identities;
DROP FUNCTION validate_pre_root();

ALTER TABLE identities DROP COLUMN pre_root;
2 changes: 1 addition & 1 deletion schemas/database/015_add_constraints_for_identities.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE UNIQUE INDEX idx_unique_deletion_leaf on identities(leaf_index) WHERE com
-- Add the new 'prev_root' column
ALTER TABLE identities ADD COLUMN pre_root BYTEA;

-- This constraint ensures that we have consistent database and changes to the tre are done in a valid sequence.
-- This constraint ensures that we have consistent database and changes to the tree are done in a valid sequence.
CREATE OR REPLACE FUNCTION validate_pre_root() returns trigger as $$
DECLARE
last_id identities.id%type;
Expand Down

0 comments on commit 7ec6199

Please sign in to comment.