[#34] 회원 / 인증 도메인 재정의 #43

Merged
pricelees merged 73 commits from refactor/#34 into main 2025-09-13 10:13:45 +00:00
2 changed files with 108 additions and 0 deletions
Showing only changes of commit 75acdc2c2f - Show all commits

View File

@ -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,

View File

@ -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,