Skip to content

Commit

Permalink
fix/#604 : MEMBER_TB에 FK Reference 명시
Browse files Browse the repository at this point in the history
  • Loading branch information
hwangdaesun committed Dec 12, 2024
1 parent 0523cd7 commit e11d044
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions resources/gaebaljip-local-environment/mariadb-init/01_schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
use gaebaljip;

CREATE TABLE `AGREEMENT_TB`
(
`AGREEMENT_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`CREATED_DATE` datetime(6) NOT NULL,
`UPDATED_DATE` datetime(6) NOT NULL,
`AGREEMENT_IS_PRIVACY_POLICY_AGREE` tinyint NOT NULL,
`AGREEMENT_IS_TERMS_SERVICE_AGREE` tinyint NOT NULL,
`AGREEMENT_IS_OVER_AGE` tinyint NOT NULL,
PRIMARY KEY (`AGREEMENT_PK`)
) ENGINE=InnoDB;

CREATE TABLE `MEMBER_TB`
(
Expand All @@ -18,18 +28,8 @@ CREATE TABLE `MEMBER_TB`
`MEMBER_TARGET_WEIGHT` double DEFAULT NULL,
`MEMBER_CHECKED` bit(1) NOT NULL DEFAULT 0,
`AGREEMENT_FK` bigint(20) NOT NULL,
PRIMARY KEY (`MEMBER_PK`)
) ENGINE=InnoDB;

CREATE TABLE `AGREEMENT_TB`
(
`AGREEMENT_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`CREATED_DATE` datetime(6) NOT NULL,
`UPDATED_DATE` datetime(6) NOT NULL,
`AGREEMENT_IS_PRIVACY_POLICY_AGREE` tinyint NOT NULL,
`AGREEMENT_IS_TERMS_SERVICE_AGREE` tinyint NOT NULL,
`AGREEMENT_IS_OVER_AGE` tinyint NOT NULL,
PRIMARY KEY (`AGREEMENT_PK`)
PRIMARY KEY (`MEMBER_PK`),
FOREIGN KEY (`AGREEMENT_FK`) REFERENCES `AGREEMENT_TB` (`AGREEMENT_PK`)
) ENGINE=InnoDB;

CREATE TABLE `FOOD_TB`
Expand Down

0 comments on commit e11d044

Please sign in to comment.