diff --git a/server/migrations/1725876544595-AddTeamCommentTable.ts b/server/migrations/1725876544595-AddTeamCommentTable.ts new file mode 100644 index 000000000..3e51c8a1e --- /dev/null +++ b/server/migrations/1725876544595-AddTeamCommentTable.ts @@ -0,0 +1,44 @@ +import type { MigrationInterface, QueryRunner } from 'typeorm'; +import { Table } from 'typeorm'; + +export class AddTeamCommentTable1725876544595 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createTable( + new Table({ + name: 'team_comment', + columns: [ + { + name: 'id', + type: 'int', + isPrimary: true, + isGenerated: true, + generationStrategy: 'increment', + }, + { + name: 'comment', + type: 'text', + }, + { + name: 'createdAt', + type: 'timestamp', + default: 'CURRENT_TIMESTAMP', + }, + { + name: 'updatedAt', + type: 'timestamp', + default: 'CURRENT_TIMESTAMP', + onUpdate: 'CURRENT_TIMESTAMP', + }, + ], + }), + true, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + const tableExists = await queryRunner.hasTable('team_comment'); + if (tableExists) { + await queryRunner.dropTable('team_comment'); + } + } +}