프로젝트를 위한 ERD를 작성해보자 😀 툴은 dbdiagram.io를 사용했으며, 도중에 변경될 수 있으니 해당 ERD링크 에서 참고하면된다.
(선정리 못하는편 😂)
Table "board" {
"id" bigint [pk, not null, increment]
"content" varchar(255) [default: NULL]
"created_date" date [default: NULL]
"title" varchar(255) [default: NULL]
"view_count" int [not null]
"writer" varchar(255) [default: NULL]
"like_count" int [not null]
}
Table "member" {
"id" bigint [pk, not null, increment]
"username" varchar(45) [not null]
"password" varchar(255) [not null]
"nickname" varchar(45) [not null]
}
Table "boardlike" {
"id" bigint [pk, not null]
"member_id" bigint
"board_id" bigint
}
Table "comment" {
"id" bigint [pk, not null, increment]
"content" varchar(255) [not null]
"created_date" date [default: NULL]
"writer" varchar(255) [not null]
"board_id" bigint
}
Table "inquiry" {
"id" bigint [pk, not null, increment]
"title" varchar(255) [not null]
"content" varchar(255) [not null]
"created_date" date [default: NULL]
"writer" varchar(255) [not null]
"reply" varchar(255) [default: NULL]
"reply_date" date [default: NULL]
"member_id" bigint
}
Table "calendar" {
"id" bigint [pk, not null, increment]
"title" varchar(255) [not null]
"description" text
"start_date" date [not null]
"end_date" date [not null]
"created_at" timestamp [not null]
"updated_at" timestamp [not null]
"created_by" bigint [not null]
"updated_by" bigint [not null]
}
Table "photoshoot" {
"id" bigint [pk, not null, increment]
"title" varchar(255) [not null]
"description" varchar(255) [not null]
"location" varchar(255) [not null]
"date" date [not null]
"time" time [not null]
"max_participants" int [not null]
"current_participants" int [not null, default: 0]
}
Table "photoshoot_application" {
"id" bigint [pk, not null, increment]
"name" varchar(255) [not null]
"email" varchar(255) [not null]
"phone" varchar(255) [not null]
"message" varchar(255) [default: NULL]
"photoshoot_id" bigint
}
Ref: "board"."id" < "boardlike"."board_id"
Ref: "member"."id" < "boardlike"."member_id"
Ref: "board"."id" < "comment"."board_id"
Ref: "member"."id" < "inquiry"."member_id"
Ref: "calendar"."created_by" < "member"."id"
Ref: "calendar"."updated_by" < "member"."id"
Ref: "photoshoot"."id" < "photoshoot_application"."photoshoot_id"
Ref: "member"."id" < "photoshoot"."id"
board_id
칼럼은 board테이블의 id
칼럼을 참조한다.board_id
칼럼은 board 테이블의 id
칼럼을 참조한다.member_id
칼럼은 member 테이블의 id
칼럼을 참조한다.create_by
및 update_by
칼럼은 member 테이블의 id
를 참조한다.photoshoot_id
칼럼은 photoshoot 테이블의 id
칼럼을 참조한다.