-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1252 from input-output-hk/fix/rewards-pldge-colum…
…n-type fix: increase the size of pledge column of stake pool rewards table
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/cardano-services/src/Projection/migrations/1715157190230-rewards-pledge-numeric.ts
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,16 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { PoolRewardsEntity } from '@cardano-sdk/projection-typeorm'; | ||
|
||
export class RewardsPledgeNumericMigration1715157190230 implements MigrationInterface { | ||
static entity = PoolRewardsEntity; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
'ALTER TABLE "pool_rewards" ALTER COLUMN "pledge" TYPE numeric(20,0) USING pledge::numeric' | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query('ALTER TABLE "pool_rewards" ALTER COLUMN "pledge" TYPE bigint USING pledge::bigint'); | ||
} | ||
} |
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