Skip to content

Commit d95f62f

Browse files
committed
feat: init.sql에 추가
1 parent 4fba563 commit d95f62f

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

docker/init.sql

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,54 @@ CREATE TABLE IF NOT EXISTS member
1414
UNIQUE KEY uk_social_user (social_type, social_id),
1515
INDEX idx_email (email),
1616
INDEX idx_deleted_at (deleted_at)
17+
);
18+
19+
CREATE TABLE IF NOT EXISTS gathering
20+
(
21+
id BIGINT AUTO_INCREMENT PRIMARY KEY,
22+
gathering_name VARCHAR(255) NOT NULL,
23+
member_id BIGINT NOT NULL,
24+
first_gathering_date DATE NOT NULL,
25+
last_gathering_date DATE NOT NULL,
26+
interval_days BIGINT NOT NULL,
27+
tags JSON NULL,
28+
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
29+
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
30+
deleted_at TIMESTAMP NULL,
31+
32+
INDEX idx_deleted_at (deleted_at),
33+
34+
CONSTRAINT fk_gathering_member FOREIGN KEY (member_id) REFERENCES member(id)
35+
);
36+
37+
CREATE TABLE IF NOT EXISTS gathering_member
38+
(
39+
id BIGINT AUTO_INCREMENT PRIMARY KEY,
40+
gathering_id BIGINT NOT NULL,
41+
member_id BIGINT NOT NULL,
42+
is_host BIT NOT NULL,
43+
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
44+
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
45+
deleted_at TIMESTAMP NULL,
46+
47+
CONSTRAINT fk_gathering_member_gathering_id FOREIGN KEY (gathering_id) REFERENCES gathering(id),
48+
CONSTRAINT fk_gathering_member_member_id FOREIGN KEY (member_id) REFERENCES member(id),
49+
INDEX idx_gathering_member (gathering_id, member_id),
50+
INDEX idx_deleted_at (deleted_at)
51+
);
52+
53+
CREATE TABLE IF NOT EXISTS invitation
54+
(
55+
id BIGINT AUTO_INCREMENT PRIMARY KEY,
56+
gathering_id BIGINT NOT NULL,
57+
member_id BIGINT NOT NULL,
58+
purpose VARCHAR(255) NOT NULL,
59+
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
60+
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
61+
deleted_at TIMESTAMP NULL,
62+
63+
CONSTRAINT fk_invitation_gathering_id FOREIGN KEY (gathering_id) REFERENCES gathering(id),
64+
CONSTRAINT fk_invitation_member_id FOREIGN KEY (member_id) REFERENCES member(id),
65+
INDEX idx_gathering_member (gathering_id, member_id),
66+
INDEX idx_deleted_at (deleted_at)
1767
);

tuk-api/src/main/kotlin/nexters/tuk/domain/BaseEntity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package nexters.tuk.domain
22

33
import jakarta.persistence.*
4-
import org.hibernate.annotations.SoftDelete
54
import org.springframework.data.annotation.CreatedDate
65
import org.springframework.data.annotation.LastModifiedDate
76
import org.springframework.data.jpa.domain.support.AuditingEntityListener
87
import java.time.LocalDateTime
98

109
@EntityListeners(AuditingEntityListener::class)
11-
@SoftDelete
1210
@MappedSuperclass
1311
abstract class BaseEntity {
1412
@Id

0 commit comments

Comments
 (0)