-- -------------------------------------------------------
-- Tables for Lookups - capture value of lookup masters
-- -------------------------------------------------------
CREATE TABLE IF NOT EXISTS lookups (
	id INT NOT NULL AUTO_INCREMENT,
	lookup_code VARCHAR(50) UNIQUE NOT NULL,
	description VARCHAR(500),
	is_shortcode_value_required VARCHAR(1) DEFAULT 'Y' ,
	is_dependent VARCHAR(1) DEFAULT 'Y' ,
	dep_parent_lookups_id INT NOT NULL,
	is_active enum('Y','N')  NOT NULL DEFAULT 'Y',
	created_at datetime(0) NOT NULL,
	created_by varchar(50) NOT NULL,
	updated_at datetime(0) NULL,
	updated_by varchar(50) NULL,
	PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB ;


-- Tables for Lookups - capture value of lookup values based on lookup masters
CREATE TABLE IF NOT EXISTS lookup_values (
	id int not null AUTO_INCREMENT,
	lookup_id int not null,	/*Table-lookups-ID*/
	short_code varchar(50) not null,	/*Short of that store on other tables or use in coding logic - this code should not be repeted against same lookup_id*/
	description varchar(500) not null,
	dep_parent_lookup_value_id int default NULL,	/*Dependend lookup_values ID*/
	is_active enum('Y','N')  NOT NULL DEFAULT 'Y',
	created_at datetime(0) NOT NULL,
	created_by varchar(50) NOT NULL,
	updated_at datetime(0) NULL,
	updated_by varchar(50) NULL,
	PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB ;


