-- 2020-05-05
-- Alter table clients for first_name, last_name, email 
-- Executed on:
ALTER TABLE tblclients ADD first_name VARCHAR(255) NULL DEFAULT NULL AFTER userid;
ALTER TABLE tblclients ADD last_name VARCHAR(255) NULL DEFAULT NULL AFTER first_name;
ALTER TABLE tblclients ADD email VARCHAR(500) NULL DEFAULT NULL AFTER last_name;
-- Create table properties for clients properties
-- Executed on:
CREATE TABLE tblclient_properties (
	id BIGINT unsigned PRIMARY KEY AUTO_INCREMENT NOT NULL,
	client_id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL,
	address varchar(100) not null,
	city varchar(100) not null,
	zip varchar(15) not null,
	state varchar(50) not null,
	addedon datetime DEFAULT current_timestamp(),
	modifiedon datetime DEFAULT current_timestamp()
)
-- Rename tenants tbl
RENAME TABLE `contractor_plus_perfex`.`tenants` TO `contractor_plus_perfex`.`tbltenants`;
-- Is the staff member tenant flag.
-- Executed on: DEV
ALTER TABLE `tblstaff` ADD `is_tenant` TINYINT(1) NOT NULL DEFAULT '0' AFTER `staffid`;