Skip to content

Commit

Permalink
add unique index on wallet public key column
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Dec 18, 2024
1 parent 1df3242 commit 6c8891c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export class CreateIndexes1697617471901 implements MigrationInterface {
CREATE INDEX wallets_attributes ON wallets using GIN(attributes);
CREATE INDEX wallets_validators ON wallets ((attributes->>'validatorPublicKey'))
WHERE (attributes ? 'validatorPublicKey');
CREATE UNIQUE INDEX wallets_unique_public_key ON wallets (public_key)
WHERE public_key IS NOT NULL;
`);
}

Expand Down Expand Up @@ -83,6 +85,7 @@ export class CreateIndexes1697617471901 implements MigrationInterface {
DROP INDEX wallets_balance;
DROP INDEX wallets_attributes;
DROP INDEX wallets_validators;
DROP INDEX wallets_unique_public_key;
`);
}
}

0 comments on commit 6c8891c

Please sign in to comment.