-
Notifications
You must be signed in to change notification settings - Fork 1
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 #52 from logion-network/hotfix/metadata-value
feat: set metadata value text.
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/logion/migration/1637834996469-MakeMetadataValueText.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,17 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class MakeMetadataValueText1637834996469 implements MigrationInterface { | ||
name = 'MakeMetadataValueText1637834996469' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "public"."loc_metadata_item" ADD "value_text" text NOT NULL DEFAULT ''`); | ||
await queryRunner.query(`ALTER TABLE "public"."loc_metadata_item" ALTER COLUMN "value" DROP NOT NULL`); | ||
await queryRunner.query(`UPDATE "public"."loc_metadata_item" SET "value_text" = "value"`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "public"."loc_metadata_item" ALTER COLUMN "value" SET NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "public"."loc_metadata_item" DROP COLUMN "value_text"`); | ||
} | ||
|
||
} |
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