CREATE TABLE tblother_promotional_campaigns (
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  campaign_name varchar(250) NOT NULL,
  campaign_code varchar(250) NOT NULL,
  where_to_display varchar(250) NOT NULL,
  start_date datetime DEFAULT NULL,
  end_date datetime DEFAULT NULL,
  type enum('always','event_based') NOT NULL,
  filter_data longtext DEFAULT NULL,
  after_how_many_days int(4) DEFAULT NULL,
  data longtext DEFAULT NULL,
  priority float(5,2) NOT NULL DEFAULT 1.00,
  show_campaign_to_staff tinyint(1) DEFAULT 0,
  added_by_admin_id bigint(20) DEFAULT NULL,
  updated_by_admin_id bigint(20) DEFAULT NULL,
  added_on datetime DEFAULT NULL,
  updated_on datetime DEFAULT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE tblvisited_other_promotional_campaigns (
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  tenant_id bigint(20) unsigned NOT NULL,
  staff_id bigint(20) unsigned NOT NULL,
  campaign_id bigint(20) unsigned NOT NULL,
  added_on datetime DEFAULT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO tblonboarding_steps_static (`id`, `code_name`, `name`, `description`, `skip_text`, `icon`, `order`, `parent`, `percentage`, `button_text`) VALUES (NULL, 'next_insurance', 'Get Insured by NEXT Insurance', 'Save up to 30% on Contractors Insurance. Starting from $29/mo.', 'Skip This Step', 'insurance_and_license.png', '1', NULL, '0.00', 'Get FREE Quote');
SET @onboarding_steps_id = LAST_INSERT_ID();

INSERT INTO tbltenant_onboarding_steps (tenant_id, onboarding_steps_static_id, STATUS, added_on, updated_on)
SELECT tenant_id,@onboarding_steps_id,0,UTC_TIMESTAMP(),UTC_TIMESTAMP()
FROM tbloptions
WHERE NAME ='license_insurance_details' AND VALUE NOT LIKE '%"is_insured":1%';

INSERT INTO tbltenant_onboarding_steps (tenant_id, onboarding_steps_static_id, STATUS, added_on, updated_on)
SELECT tenant_id,@onboarding_steps_id,1,UTC_TIMESTAMP(),UTC_TIMESTAMP()
FROM tbloptions
WHERE NAME ='license_insurance_details' AND VALUE LIKE '%"is_insured":1%';