Files
bio_backend/ddl/schema.sql

292 lines
7.8 KiB
SQL

create table st_common_code (
sort_order integer not null,
use_flag boolean not null,
created_at timestamp(6) not null,
created_oid bigint,
oid bigint not null,
updated_at timestamp(6) not null,
updated_oid bigint,
code varchar(50) not null unique,
group_code varchar(50) not null,
parent_code varchar(50),
character_ref1 varchar(100),
character_ref2 varchar(100),
character_ref3 varchar(100),
character_ref4 varchar(100),
character_ref5 varchar(100),
name varchar(100) not null,
description varchar(500),
created_id varchar(255),
updated_id varchar(255),
primary key (oid)
);
comment on column st_common_code.sort_order is
'정렬 순번';
comment on column st_common_code.use_flag is
'사용 여부';
comment on column st_common_code.created_at is
'생성일시';
comment on column st_common_code.created_oid is
'생성자 OID';
comment on column st_common_code.oid is
'OID';
comment on column st_common_code.updated_at is
'수정일시';
comment on column st_common_code.updated_oid is
'수정자 OID';
comment on column st_common_code.code is
'코드';
comment on column st_common_code.group_code is
'그룹 코드';
comment on column st_common_code.parent_code is
'부모 코드';
comment on column st_common_code.character_ref1 is
'문자 참조1';
comment on column st_common_code.character_ref2 is
'문자 참조2';
comment on column st_common_code.character_ref3 is
'문자 참조3';
comment on column st_common_code.character_ref4 is
'문자 참조4';
comment on column st_common_code.character_ref5 is
'문자 참조5';
comment on column st_common_code.name is
'코드명';
comment on column st_common_code.description is
'설명';
comment on column st_common_code.created_id is
'생성자 ID';
comment on column st_common_code.updated_id is
'수정자 ID';
create table st_common_group_code (
sort_order integer not null,
use_flag boolean not null,
created_at timestamp(6) not null,
created_oid bigint,
oid bigint not null,
updated_at timestamp(6) not null,
updated_oid bigint,
code varchar(50) not null unique,
character_ref1_title varchar(100),
character_ref2_title varchar(100),
character_ref3_title varchar(100),
character_ref4_title varchar(100),
character_ref5_title varchar(100),
name varchar(100) not null,
created_id varchar(255),
updated_id varchar(255),
primary key (oid)
);
comment on column st_common_group_code.sort_order is
'정렬 순번';
comment on column st_common_group_code.use_flag is
'사용 여부';
comment on column st_common_group_code.created_at is
'생성일시';
comment on column st_common_group_code.created_oid is
'생성자 OID';
comment on column st_common_group_code.oid is
'OID';
comment on column st_common_group_code.updated_at is
'수정일시';
comment on column st_common_group_code.updated_oid is
'수정자 OID';
comment on column st_common_group_code.code is
'코드';
comment on column st_common_group_code.character_ref1_title is
'문자 참조 타이틀1';
comment on column st_common_group_code.character_ref2_title is
'문자 참조 타이틀2';
comment on column st_common_group_code.character_ref3_title is
'문자 참조 타이틀3';
comment on column st_common_group_code.character_ref4_title is
'문자 참조 타이틀4';
comment on column st_common_group_code.character_ref5_title is
'문자 참조 타이틀5';
comment on column st_common_group_code.name is
'코드명';
comment on column st_common_group_code.created_id is
'생성자 ID';
comment on column st_common_group_code.updated_id is
'수정자 ID';
create table st_file (
use_flag boolean not null,
created_at timestamp(6) not null,
created_oid bigint,
file_size bigint not null,
group_oid bigint,
oid bigint not null,
updated_at timestamp(6) not null,
updated_oid bigint,
content_type varchar(255) not null,
created_id varchar(255),
description varchar(255),
file_path varchar(255) not null,
original_file_name varchar(255) not null,
stored_file_name varchar(255) not null,
updated_id varchar(255),
primary key (oid)
);
comment on column st_file.use_flag is
'사용 여부';
comment on column st_file.created_at is
'생성일시';
comment on column st_file.created_oid is
'생성자 OID';
comment on column st_file.file_size is
'파일 크기';
comment on column st_file.group_oid is
'그룹 OID';
comment on column st_file.oid is
'OID';
comment on column st_file.updated_at is
'수정일시';
comment on column st_file.updated_oid is
'수정자 OID';
comment on column st_file.content_type is
'콘텐츠 타입';
comment on column st_file.created_id is
'생성자 ID';
comment on column st_file.description is
'설명';
comment on column st_file.file_path is
'파일 경로';
comment on column st_file.original_file_name is
'원본 파일명';
comment on column st_file.stored_file_name is
'저장 파일명';
comment on column st_file.updated_id is
'수정자 ID';
create table st_member (
use_flag boolean not null,
created_at timestamp(6) not null,
created_oid bigint,
last_login_at timestamp(6),
oid bigint not null,
updated_at timestamp(6) not null,
updated_oid bigint,
login_ip varchar(45),
name varchar(100) not null,
password varchar(100) not null,
user_id varchar(100) not null,
refresh_token varchar(1024),
created_id varchar(255),
email varchar(255) not null,
updated_id varchar(255),
primary key (oid)
);
comment on column st_member.use_flag is
'사용 여부';
comment on column st_member.created_at is
'생성일시';
comment on column st_member.created_oid is
'생성자 OID';
comment on column st_member.last_login_at is
'마지막 로그인 일시';
comment on column st_member.oid is
'OID';
comment on column st_member.updated_at is
'수정일시';
comment on column st_member.updated_oid is
'수정자 OID';
comment on column st_member.login_ip is
'로그인 IP';
comment on column st_member.name is
'이름';
comment on column st_member.password is
'비밀번호';
comment on column st_member.user_id is
'사용자 ID';
comment on column st_member.refresh_token is
'리프레시 토큰';
comment on column st_member.created_id is
'생성자 ID';
comment on column st_member.email is
'이메일';
comment on column st_member.updated_id is
'수정자 ID';
create index idx_common_code_code
on st_common_code (code);
create index idx_common_code_group_code
on st_common_code (group_code);
create index idx_common_code_parent_code
on st_common_code (parent_code);
create index idx_common_group_code_code
on st_common_group_code (code);
create index idx_member_user_id
on st_member (user_id);