/* 
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 * Table Name	: TInventoryData
 * Description	: BMS Inventory Data
 * createAt		: 2020.12.02
 * createBy		: JK.Woo
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */
drop table if exists TInventoryData;
--drop sequence if exists inventory_data_seq;

--create sequence inventory_data_seq start 1;

create table TInventoryData
(
	manufacture_date	integer			not null				,
	pcb_sn				varchar(20)		not null				,
	module_sn			varchar(32)		null					,
	create_date			timestamp		not null				,
	modify_date			timestamp		not null				,

    primary key (pcb_sn)
);
create index inventory_data_idx1 on TInventoryData (pcb_sn);
create index inventory_data_idx2 on TInventoryData (module_sn);

/* 
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 * Table Name	: TErrorLogTable
 * Description	: Error Message Log Table
 * createAt		: 2019.11.04
 * createBy		: JK.Woo
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */
drop table if exists TErrorLogTable;
--drop sequence if exists module_group_seq;

--create sequence module_group_seq start 1;

create table TErrorLogTable
(
	create_date									timestamp		not null				,
	pcb_sn										varchar(20)		not null				,
	module_sn									varchar(32)		null					,
	PROCESS										varchar(20)		not null				,
	ERROR_TYPE									varchar(100)	not null				,
	ERROR_MSG									varchar(200)	not null
);

