ALTER TABLE configure.accounts DROP COLUMN support_phone;

ALTER TABLE configure.accounts ADD COLUMN assigned_csm int(11) DEFAULT NULL AFTER support_name;
ALTER TABLE configure.accounts ADD COLUMN csm_tier int(11) DEFAULT NULL AFTER assigned_csm;
ALTER TABLE configure.accounts ADD COLUMN contract_date date DEFAULT NULL AFTER csm_tier;
ALTER TABLE configure.accounts ADD COLUMN population_scope int(11) DEFAULT NULL AFTER contract_date;
ALTER TABLE configure.accounts ADD COLUMN population_size int(11) DEFAULT NULL AFTER population_scope;
ALTER TABLE configure.accounts ADD COLUMN account_arr DECIMAL(11,2) DEFAULT NULL AFTER population_size;
ALTER TABLE configure.accounts ADD COLUMN account_arr_date date DEFAULT NULL AFTER account_arr;

CREATE TABLE configure.population_scope (
	population_scope_id int(11) auto_increment PRIMARY KEY,
    population_name varchar(150) DEFAULT NULL,
    display_order int(11) DEFAULT NULL
);

INSERT INTO configure.population_scope (population_name, display_order) VALUES ('Full Org', 1), ('Division', 2), ('Department', 3), ('Team', 4);

CREATE TABLE configure.account_tier (
	account_tier_id int(11) auto_increment PRIMARY KEY,
    account_tier_name varchar(125) DEFAULT NULL,
    display_order int(11) DEFAULT NULL
);

INSERT INTO configure.account_tier (account_tier_name, display_order) VALUES ('Tier 1', 1), ('Tier 2', 2), ('Tier 3', 3);

ALTER TABLE configure.trial_accounts ADD COLUMN account_id int(11) DEFAULT NULL;
ALTER TABLE configure.trial_accounts ADD COLUMN is_deleted tinyint(1) DEFAULT 0;

ALTER TABLE configure.accounts ADD COLUMN access_trial_account tinyint(1) DEFAULT 0 AFTER is_trial_account;

DROP TABLE configure.account_tier;
DROP TABLE configure.population_scope;


ALTER TABLE configure.accounts DROP COLUMN assigned_csm;
ALTER TABLE configure.accounts DROP COLUMN csm_tier;
ALTER TABLE configure.accounts DROP COLUMN contract_date;
ALTER TABLE configure.accounts DROP COLUMN population_scope;
ALTER TABLE configure.accounts DROP COLUMN population_size;
ALTER TABLE configure.accounts DROP COLUMN account_arr;
ALTER TABLE configure.accounts DROP COLUMN account_arr_date;