-- -----------------------------------------------------
-- Table CustomerCustomField
-- -----------------------------------------------------
DROP TABLE IF EXISTS CustomerCustomField;

CREATE TABLE CustomerCustomField (
  id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(100) NOT NULL,
  type VARCHAR(100) NOT NULL,
  menu_list VARCHAR(500) DEFAULT NULL,
  is_mandatory TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
  show_in_form TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (id)
) ENGINE=InnoDB CHARACTER SET utf8;
CREATE UNIQUE INDEX customer_field_name_idx ON CustomerCustomField(name);


-- -----------------------------------------------------
-- Table CustomerCustomInfo
-- -----------------------------------------------------

DROP TABLE IF EXISTS CustomerCustomInfo;

CREATE TABLE CustomerCustomInfo (
  customer_id MEDIUMINT UNSIGNED NOT NULL,
  PRIMARY KEY (customer_id),
  FOREIGN KEY (customer_id)
    REFERENCES Customer (id)
    ON DELETE NO ACTION
    ON UPDATE CASCADE
) ENGINE=InnoDB CHARACTER SET utf8;

