ALTER TABLE users ADD dw_user bool DEFAULT false  NULL;
ALTER TABLE users ADD client_id int NULL;
ALTER TABLE users ADD can_log_in bool DEFAULT false  NULL;

CREATE TABLE clients
(
  client_id int PRIMARY KEY AUTO_INCREMENT,
  client_name varchar(150),
  client_logo_path varchar(500),
  has_ee bool,
  has_360 bool,
  has_360_ongoing bool,
  tier_id int,
  stage_id int
);

CREATE TABLE client_tiers
(
  tier_id int PRIMARY KEY AUTO_INCREMENT,
  tier_name int
);

CREATE TABLE client_stages
(
  stage_id int PRIMARY KEY AUTO_INCREMENT,
  stage_name int
);

CREATE TABLE dw_roles
(
  role_id int,
  role_name int
);

CREATE TABLE client_contacts
(
  contact_id int PRIMARY KEY AUTO_INCREMENT,
  client_id int,
  user_id int
);

ALTER TABLE users ADD phone varchar(40) NULL;

CREATE TABLE projects
(
  project_id int PRIMARY KEY AUTO_INCREMENT,
  project_name varchar(300),
  client_id int,
  start_date date,
  end_date date,
  project_type_id int
);

CREATE TABLE project_types
(
  project_type_id int PRIMARY KEY AUTO_INCREMENT,
  project_type_name varchar(75)
);

CREATE TABLE chart_notes
(
  chart_note_id int PRIMARY KEY AUTO_INCREMENT,
  client_id int,
  project_id int,
  user_id int,
  chart_note_date date,
  chart_note text
);

ALTER TABLE users ADD avatar_path varchar(500) NULL;

ALTER TABLE client_tiers MODIFY tier_name varchar(20);
ALTER TABLE client_stages MODIFY stage_name varchar(80);

ALTER TABLE clients ADD client_health_index int NULL;

create table ep_platform.user_to_client
(
  id        int auto_increment
    primary key,
  user_id   int null,
  client_id int null
);

ALTER TABLE user_to_client ADD role_id int NULL;

/* 6-19-2019 */