From 75acdc2c2f193ed3322252b817cffdd01bae6840 Mon Sep 17 00:00:00 2001 From: pricelees Date: Thu, 11 Sep 2025 16:24:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90,=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=9E=90=20=EB=B0=8F=20=EC=83=81=ED=83=9C=20/=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=B3=80=EA=B2=BD=20=EC=9D=B4?= =?UTF-8?q?=EB=A0=A5=20=EC=8A=A4=ED=82=A4=EB=A7=88=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/schema/schema-h2.sql | 54 ++++++++++++++++++++++ src/main/resources/schema/schema-mysql.sql | 54 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/src/main/resources/schema/schema-h2.sql b/src/main/resources/schema/schema-h2.sql index 64c1439d..978bbae1 100644 --- a/src/main/resources/schema/schema-h2.sql +++ b/src/main/resources/schema/schema-h2.sql @@ -18,6 +18,60 @@ create table if not exists members ( last_modified_at timestamp ); +create table if not exists users( + id bigint primary key, + name varchar(50) not null, + email varchar(255) not null, + password varchar(255) not null, + phone varchar(20) not null, + region_code varchar(10) not null, + status varchar(20) not null, + created_at timestamp not null, + created_by bigint not null, + updated_at timestamp not null, + updated_by bigint not null, + + constraint uk__users_email unique (email), + constraint uk__users_phone unique (phone), + constraint fk__users_region_code foreign key (region_code) references region (code) +); + +create table if not exists user_status_history( + id bigint primary key, + user_id bigint not null, + status varchar(20) not null, + reason varchar(255) not null, + created_at timestamp not null, + created_by bigint not null, + updated_at timestamp not null, + updated_by bigint not null, + + constraint fk__user_status_history_user_id foreign key (user_id) references users (id) +); + +create table if not exists admin( + id bigint primary key, + account varchar(20) not null, + password varchar(255) not null, + name varchar(20) not null, + phone varchar(20) not null, + permission_level varchar(20) not null, + created_at timestamp not null, + created_by bigint not null, + updated_at timestamp not null, + updated_by bigint not null +); + +create table if not exists login_history( + id bigint primary key, + principal_id bigint not null, + principal_type varchar(20) not null, + success boolean not null, + ip_address varchar(45) not null, + user_agent varchar(255) not null, + created_at timestamp not null +); + create table if not exists theme ( id bigint primary key , name varchar(30) not null, diff --git a/src/main/resources/schema/schema-mysql.sql b/src/main/resources/schema/schema-mysql.sql index cae84864..54d4d19d 100644 --- a/src/main/resources/schema/schema-mysql.sql +++ b/src/main/resources/schema/schema-mysql.sql @@ -19,6 +19,60 @@ create table if not exists members last_modified_at datetime(6) null ); +create table if not exists users( + id bigint primary key, + name varchar(50) not null, + email varchar(255) not null, + password varchar(255) not null, + phone varchar(20) not null, + region_code varchar(10) not null, + status varchar(20) not null, + created_at datetime(6) not null, + created_by bigint not null, + updated_at datetime(6) not null, + updated_by bigint not null, + + constraint uk__users_email unique (email), + constraint uk__users_phone unique (phone), + constraint fk__users_region_code foreign key (region_code) references region (code) +); + +create table if not exists user_status_history( + id bigint primary key, + user_id bigint not null, + status varchar(20) not null, + reason varchar(255) not null, + created_at datetime(6) not null, + created_by bigint not null, + updated_at datetime(6) not null, + updated_by bigint not null, + + constraint fk__user_status_history_user_id foreign key (user_id) references users (id) +); + +create table if not exists admin( + id bigint primary key, + account varchar(20) not null, + password varchar(255) not null, + name varchar(20) not null, + phone varchar(20) not null, + permission_level varchar(20) not null, + created_at datetime(6) not null, + created_by bigint not null, + updated_at datetime(6) not null, + updated_by bigint not null +); + +create table if not exists login_history( + id bigint primary key, + principal_id bigint not null, + principal_type varchar(20) not null, + success boolean not null, + ip_address varchar(45) not null, + user_agent varchar(255) not null, + created_at datetime(6) not null +); + create table if not exists theme ( id bigint primary key , name varchar(30) not null,