diff --git a/migrations/1701696068699-notice-board-change-column-name.ts b/migrations/1701696068699-notice-board-change-column-name.ts index 11b979de..7030372e 100644 --- a/migrations/1701696068699-notice-board-change-column-name.ts +++ b/migrations/1701696068699-notice-board-change-column-name.ts @@ -1,123 +1,123 @@ -// import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; -// export class NoticeBoardChangeColumnName1701696068699 -// implements MigrationInterface -// { -// public async up(queryRunner: QueryRunner): Promise { -// await queryRunner.changeColumn( -// 'notice_board', -// 'allow_comment', -// new TableColumn({ -// name: 'is_allow_comment', -// type: 'boolean', -// default: true, -// isNullable: false, -// comment: '댓글 허용 여부 (0: 비활성화, 1: 허용)', -// }), -// ); +export class NoticeBoardChangeColumnName1701696068699 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.changeColumn( + 'notice_board', + 'allow_comment', + new TableColumn({ + name: 'is_allow_comment', + type: 'boolean', + default: true, + isNullable: false, + comment: '댓글 허용 여부 (0: 비활성화, 1: 허용)', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_comment', -// 'isAnonymous', -// new TableColumn({ -// name: 'is_anonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_comment', + 'isAnonymous', + new TableColumn({ + name: 'is_anonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_reply_comment', -// 'isAnonymous', -// new TableColumn({ -// name: 'is_anonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_reply_comment', + 'isAnonymous', + new TableColumn({ + name: 'is_anonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_history', -// 'allow_comment', -// new TableColumn({ -// name: 'is_allow_comment', -// type: 'boolean', -// default: true, -// isNullable: false, -// comment: '댓글 허용 여부 (0: 비활성화, 1: 허용)', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_history', + 'allow_comment', + new TableColumn({ + name: 'is_allow_comment', + type: 'boolean', + default: true, + isNullable: false, + comment: '댓글 허용 여부 (0: 비활성화, 1: 허용)', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_comment_history', -// 'isAnonymous', -// new TableColumn({ -// name: 'is_anonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_comment_history', + 'isAnonymous', + new TableColumn({ + name: 'is_anonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_reply_comment_history', -// 'isAnonymous', -// new TableColumn({ -// name: 'is_anonymous', -// type: 'tinyint', -// }), -// ); -// } + await queryRunner.changeColumn( + 'notice_board_reply_comment_history', + 'isAnonymous', + new TableColumn({ + name: 'is_anonymous', + type: 'tinyint', + }), + ); + } -// public async down(queryRunner: QueryRunner): Promise { -// await queryRunner.changeColumn( -// 'notice_board', -// 'is_allow_comment', -// new TableColumn({ -// name: 'allow_comment', -// type: 'boolean', -// }), -// ); + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.changeColumn( + 'notice_board', + 'is_allow_comment', + new TableColumn({ + name: 'allow_comment', + type: 'boolean', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_comment', -// 'is_anonymous', -// new TableColumn({ -// name: 'isAnonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_comment', + 'is_anonymous', + new TableColumn({ + name: 'isAnonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_reply_comment', -// 'is_anonymous', -// new TableColumn({ -// name: 'isAnonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_reply_comment', + 'is_anonymous', + new TableColumn({ + name: 'isAnonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_history', -// 'is_allow_comment', -// new TableColumn({ -// name: 'allow_comment', -// type: 'boolean', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_history', + 'is_allow_comment', + new TableColumn({ + name: 'allow_comment', + type: 'boolean', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_comment_history', -// 'is_anonymous', -// new TableColumn({ -// name: 'isAnonymous', -// type: 'tinyint', -// }), -// ); + await queryRunner.changeColumn( + 'notice_board_comment_history', + 'is_anonymous', + new TableColumn({ + name: 'isAnonymous', + type: 'tinyint', + }), + ); -// await queryRunner.changeColumn( -// 'notice_board_reply_comment_history', -// 'is_anonymous', -// new TableColumn({ -// name: 'isAnonymous', -// type: 'tinyint', -// }), -// ); -// } -// } + await queryRunner.changeColumn( + 'notice_board_reply_comment_history', + 'is_anonymous', + new TableColumn({ + name: 'isAnonymous', + type: 'tinyint', + }), + ); + } +}