summary refs log tree commit diff
path: root/src/database/migration/postgres/1771271159006-set-role-managed-default.ts
blob: fad55f23799686661aa9354586c330dc043a127b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { MigrationInterface, QueryRunner } from "typeorm";

export class SetRoleManagedDefault1771271159006 implements MigrationInterface {
    name = "SetRoleManagedDefault1771271159006";

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "roles" ALTER COLUMN "managed" SET DEFAULT false`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "roles" ALTER COLUMN "managed" DROP DEFAULT`);
    }
}