-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: DDL 작성 * feat: 로그인 시 멤버 마지막 로그인일 업데이트하도록 * fix: schema.sql * fix: member_roles 컬럼 타입 수정 * chore * feat: datatime 컬럼 default 추가
- Loading branch information
Showing
4 changed files
with
128 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,5 +77,4 @@ class BundleCustomRepositoryImpl(private val queryFactory: JPAQueryFactory) : Bu | |
) | ||
.fetch() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
CREATE TABLE IF NOT EXISTS member | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
nickname VARCHAR(20) NULL, | ||
email VARCHAR(50) NOT NULL, | ||
provider VARCHAR(10) NOT NULL, | ||
profile_image TEXT NULL, | ||
bundle_order TEXT NOT NULL, | ||
member_roles VARBINARY(255) NULL, | ||
last_logged_in_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
deleted_at DATETIME NULL, | ||
UNIQUE INDEX member_unique_idx_nickname (nickname), | ||
UNIQUE INDEX member_unique_idx_email (email) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS sns | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(20) NOT NULL, | ||
url TEXT NOT NULL, | ||
member_id BIGINT UNSIGNED NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS bundle | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL, | ||
question_order TEXT NOT NULL, | ||
scrape_count BIGINT UNSIGNED NOT NULL DEFAULT 0, | ||
share_type VARCHAR(10) NOT NULL, | ||
origin_id BIGINT UNSIGNED NULL, | ||
member_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
INDEX bundle_idx_name (name), | ||
FULLTEXT INDEX bundle_fulltext_idx_name (name) WITH PARSER ngram | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS question | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
content VARCHAR(300) NOT NULL, | ||
answer VARCHAR(1500) NULL, | ||
answer_share_type VARCHAR(10) NOT NULL, | ||
share_count BIGINT UNSIGNED NOT NULL DEFAULT 0, | ||
origin_id BIGINT UNSIGNED NULL, | ||
bundle_id BIGINT UNSIGNED NOT NULL, | ||
member_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
INDEX question_idx_content (content), | ||
FULLTEXT INDEX question_fulltext_idx_content (content) WITH PARSER ngram | ||
); | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS tag | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL, | ||
UNIQUE INDEX tag_unique_idx_name (name), | ||
FULLTEXT INDEX tag_fulltext_idx_name (name) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS member_tag | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
member_id BIGINT UNSIGNED NOT NULL, | ||
tag_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS bundle_tag | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
bundle_id BIGINT UNSIGNED NOT NULL, | ||
tag_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS question_tag | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
question_id BIGINT UNSIGNED NOT NULL, | ||
tag_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS question_report | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
reason VARCHAR(100) NOT NULL, | ||
question_id BIGINT UNSIGNED NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS claim | ||
( | ||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | ||
content TEXT NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters