모델 코멘트 입력

This commit is contained in:
2025-04-26 08:04:04 +09:00
parent d1b22d4272
commit 283c8a7f4a
18 changed files with 293 additions and 140 deletions
+27 -13
View File
@@ -7,7 +7,8 @@ const Member = sequelize.define('Member', {
id: {
type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true,
autoIncrement: true
autoIncrement: true,
comment: '회원 고유 식별자'
},
clubId: {
type: DataTypes.INTEGER.UNSIGNED,
@@ -15,7 +16,8 @@ const Member = sequelize.define('Member', {
references: {
model: 'Clubs',
key: 'id'
}
},
comment: '소속 클럽 ID'
},
userId: {
type: DataTypes.INTEGER.UNSIGNED,
@@ -23,56 +25,68 @@ const Member = sequelize.define('Member', {
references: {
model: 'Users',
key: 'id'
}
},
comment: '유저 ID'
},
name: {
type: DataTypes.STRING,
allowNull: false
allowNull: false,
comment: '회원 이름'
},
gender: {
type: DataTypes.ENUM('남성', '여성'),
allowNull: false
allowNull: false,
comment: '성별'
},
memberType: {
type: DataTypes.ENUM('정회원', '준회원', '운영진', '모임장'),
allowNull: false,
defaultValue: '준회원'
defaultValue: '준회원',
comment: '회원 유형'
},
handicap: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0
defaultValue: 0,
comment: '핸디캡'
},
average: {
type: DataTypes.FLOAT,
allowNull: false,
defaultValue: 0
defaultValue: 0,
comment: '평균 점수'
},
games: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0
defaultValue: 0,
comment: '게임 수'
},
phone: {
type: DataTypes.STRING,
allowNull: true
allowNull: true,
comment: '전화번호'
},
email: {
type: DataTypes.STRING,
allowNull: true
allowNull: true,
comment: '이메일'
},
joinDate: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW
defaultValue: DataTypes.NOW,
comment: '가입일'
},
status: {
type: DataTypes.ENUM('active', 'inactive', 'suspended', 'deleted'),
allowNull: false,
defaultValue: 'active'
defaultValue: 'active',
comment: '회원 상태'
}
}, {
tableName: 'Members',
comment: '클럽 회원 정보를 저장하는 테이블',
timestamps: true
});
Member.associate = (models) => {