ToolJet/server/migrations/1625814801416-CreateOrganizations.ts
2021-07-22 23:42:06 +05:30

45 lines
1 KiB
TypeScript

import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm";
export class CreateOrganizations1625814801416 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(new Table({
name: "organizations",
columns: [
{
name: "id",
type: "uuid",
isGenerated: true,
default: "gen_random_uuid()",
isPrimary: true
},
{
name: "name",
type: "varchar",
isNullable: true
},
{
name: "domain",
type: "varchar",
isNullable: true
},
{
name: "created_at",
type: "timestamp",
isNullable: true,
default: "now()"
},
{
name: "updated_at",
type: "timestamp",
isNullable: true,
default: "now()"
}
]
}), true)
}
public async down(queryRunner: QueryRunner): Promise<void> {
}
}