-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unique denom, explorer_id in asset table
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class addUniqueExplorer1731292627732 implements MigrationInterface { | ||
name = 'addUniqueExplorer1731292627732'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`DROP INDEX \`IDX_dfaa8912e3a864dae14becfe74\` ON \`asset\``, | ||
); | ||
await queryRunner.query( | ||
`CREATE UNIQUE INDEX \`IDX_caab7846c80a2a9f5ed9d515d8\` ON \`asset\` (\`denom\`, \`explorer_id\`)`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`DROP INDEX \`IDX_caab7846c80a2a9f5ed9d515d8\` ON \`asset\``, | ||
); | ||
await queryRunner.query( | ||
`CREATE UNIQUE INDEX \`IDX_dfaa8912e3a864dae14becfe74\` ON \`asset\` (\`denom\`)`, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters