Skip to content

Commit

Permalink
🗃️ [STMT-220] 테이블 study_domain 외래키 제약조건 변경 및 각 필드 데이터 크기 증대 (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
05AM authored Mar 22, 2024
1 parent 5ed5616 commit 5d6c537
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/resources/db/migration/V1.4__add_study_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ CREATE TABLE `study_field`

CREATE TABLE `study_domain`
(
`id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '스터디 태그 ID',
`study_field_id` BIGINT NOT NULL COMMENT '스터디 분야 ID',
`id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '스터디 도메인 ID',
`study_field_id` BIGINT NULL COMMENT '스터디 분야 ID',

CONSTRAINT fk_study_field FOREIGN KEY (study_field_id)
CONSTRAINT fk_study_domain_with_field FOREIGN KEY (study_field_id)
REFERENCES study_field (id)
ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE = InnoDB
Expand All @@ -24,10 +24,10 @@ CREATE TABLE `study`
`study_domain_id` BIGINT NOT NULL COMMENT '스터디 도메인 ID',
`name` VARCHAR(255) NOT NULL COMMENT '스터디명',
`region` VARCHAR(50) NOT NULL COMMENT '활동 지역',
`intro` VARCHAR(100) NOT NULL COMMENT '소개',
`rule` VARCHAR(100) NULL COMMENT '규칙',
`intro` VARCHAR(200) NOT NULL COMMENT '소개',
`rule` VARCHAR(200) NULL COMMENT '규칙',
`image` VARCHAR(500) NOT NULL COMMENT '스터디 이미지의 URL',
`headcount` TINYINT(50) NOT NULL DEFAULT 1 COMMENT '인원 수',
`headcount` TINYINT(100) NOT NULL DEFAULT 1 COMMENT '인원 수',
`start_date` DATETIME NOT NULL COMMENT '시작일',
`end_date` DATETIME NOT NULL COMMENT '종료일',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 시간',
Expand All @@ -48,7 +48,7 @@ CREATE TABLE `study_tag`
(
`id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '스터디 태그 ID',
`study_domain_id` BIGINT NOT NULL COMMENT '스터디 관련 ID',
`name` VARCHAR(10) NOT NULL COMMENT '태그명',
`name` VARCHAR(20) NOT NULL COMMENT '태그명',

CONSTRAINT fk_study_domain_with_tag FOREIGN KEY (study_domain_id)
REFERENCES study_domain (id)
Expand Down

0 comments on commit 5d6c537

Please sign in to comment.