diff options
Diffstat (limited to 'src/util/migrations/postgres/1659921826567-premium_since_as_date.ts')
-rw-r--r-- | src/util/migrations/postgres/1659921826567-premium_since_as_date.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/util/migrations/postgres/1659921826567-premium_since_as_date.ts b/src/util/migrations/postgres/1659921826567-premium_since_as_date.ts new file mode 100644 index 00000000..ac1e2edb --- /dev/null +++ b/src/util/migrations/postgres/1659921826567-premium_since_as_date.ts @@ -0,0 +1,26 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class premiumSinceAsDate1659921826567 implements MigrationInterface { + name = 'premiumSinceAsDate1659921826567' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(` + ALTER TABLE "members" DROP COLUMN "premium_since" + `); + await queryRunner.query(` + ALTER TABLE "members" + ADD "premium_since" TIMESTAMP + `); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(` + ALTER TABLE "members" DROP COLUMN "premium_since" + `); + await queryRunner.query(` + ALTER TABLE "members" + ADD "premium_since" bigint + `); + } + +} |