File tree 2 files changed +21
-1
lines changed
packages/cardano-services/src/Projection/migrations
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { HandleEntity } from '@cardano-sdk/projection-typeorm' ;
2
+ import { MigrationInterface , QueryRunner } from 'typeorm' ;
3
+
4
+ export class HandleParentMigration1700556589063 implements MigrationInterface {
5
+ static entity = HandleEntity ;
6
+
7
+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
8
+ await queryRunner . query ( 'ALTER TABLE "handle" ADD COLUMN "parent_handle_handle" character varying' ) ;
9
+ await queryRunner . query (
10
+ 'ALTER TABLE "handle" ADD CONSTRAINT "FK_handle_parent_handle_handle" FOREIGN KEY ("parent_handle_handle") REFERENCES "handle"("handle") ON DELETE CASCADE ON UPDATE NO ACTION'
11
+ ) ;
12
+ }
13
+
14
+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
15
+ await queryRunner . query ( 'ALTER TABLE "handle" DROP CONSTRAINT "FK_handle_parent_handle_handle"' ) ;
16
+ await queryRunner . query ( 'ALTER TABLE "handle" DROP COLUMN "parent_handle_handle"' ) ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { FkPoolRegistrationMigration1682519108369 } from './1682519108369-fk-poo
8
8
import { FkPoolRetirementMigration1682519108370 } from './1682519108370-fk-pool-retirement' ;
9
9
import { HandleDefaultMigrations1693830294136 } from './1693830294136-handle-default-columns' ;
10
10
import { HandleMetadataTableMigrations1693490983715 } from './1693490983715-handle-metadata-table' ;
11
+ import { HandleParentMigration1700556589063 } from './1700556589063-handle-parent' ;
11
12
import { HandleTableMigration1686138943349 } from './1686138943349-handle-table' ;
12
13
import { NftMetadataTableMigration1690269355640 } from './1690269355640-nft-metadata-table' ;
13
14
import { OutputTableMigration1682519108367 } from './1682519108367-output-table' ;
@@ -49,5 +50,6 @@ export const migrations: ProjectionMigration[] = [
49
50
HandleDefaultMigrations1693830294136 ,
50
51
PoolDelistedTableMigration1695899010515 ,
51
52
CurrentStakePollMetricsAttributesMigrations1698174358997 ,
52
- PoolRewardsTableMigrations1698175956871
53
+ PoolRewardsTableMigrations1698175956871 ,
54
+ HandleParentMigration1700556589063
53
55
] ;
You can’t perform that action at this time.
0 commit comments