You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gristlabs_grist-core/app/gen-server/migration/1652273656610-Activations.ts

41 lines
1.1 KiB

import * as sqlUtils from "app/gen-server/sqlUtils";
import {MigrationInterface, QueryRunner, Table} from 'typeorm';
export class Activations1652273656610 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
// created_at and updated_at code is based on *-Initial.ts
const dbType = queryRunner.connection.driver.options.type;
const datetime = sqlUtils.datetime(dbType);
const now = sqlUtils.now(dbType);
await queryRunner.createTable(new Table({
name: 'activations',
columns: [
{
name: "id",
type: "varchar",
isPrimary: true,
},
{
name: "key",
type: "varchar",
isNullable: true,
},
{
name: "created_at",
type: datetime,
default: now
},
{
name: "updated_at",
type: datetime,
default: now
},
]}));
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropTable('activations');
}
}