ToolJet/server/migrations/1651056032050-CreateFiles.ts

32 lines
742 B
TypeScript
Raw Normal View History

import { MigrationInterface, QueryRunner, Table } from 'typeorm';
export class CreateFiles1651056032050 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'files',
columns: [
{
name: 'id',
type: 'uuid',
isGenerated: true,
default: 'gen_random_uuid()',
isPrimary: true,
},
{
name: 'data',
type: 'bytea',
},
{
name: 'filename',
type: 'varchar',
},
],
}),
true
);
}
public async down(queryRunner: QueryRunner): Promise<void> {}
}