Skip to content

Commit

Permalink
setting(#316): add utility methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hobiJeong committed Mar 7, 2024
1 parent aa09a96 commit 029b5b0
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/migrations/__utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,53 @@ export const generatePrimaryColumn = (
};
};

export const generateUserIdColumn = (
comment: string = '유저 고유 ID',
): TableColumnOptions => {
return {
name: 'user_id',
type: 'int',
unsigned: true,
isNullable: false,
comment,
};
};

export const generateCategoryIdColumn = (
comment: string = '카테고리 고유 ID',
): TableColumnOptions => {
return {
name: 'category_id',
type: 'int',
unsigned: true,
isNullable: false,
comment,
};
};

export const generateHeadColumn = (
comment: string = '게시글 제목',
): TableColumnOptions => {
return {
name: 'head',
type: 'varchar',
length: '30',
isNullable: false,
comment,
};
};

export const generateBodyColumn = (
comment: string = '게시글 본문',
): TableColumnOptions => {
return {
name: 'body',
type: 'text',
isNullable: false,
comment,
};
};

export const generateBooleanColumn = (
name: string,
comment: string,
Expand Down

0 comments on commit 029b5b0

Please sign in to comment.