SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';


-- -----------------------------------------------------
-- Table `person`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `person` (
  `person_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  `last_name` VARCHAR(45) NULL ,
  `first_name` VARCHAR(45) NULL ,
  `relationship` ENUM('Family','Friend','Colleague','Other') NULL ,
  `inserted` DATETIME NULL ,
  `updated` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP ,
  PRIMARY KEY (`person_id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `phone_number`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `phone_number` (
  `phone_number_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  `person_id` INT UNSIGNED NOT NULL DEFAULT 0 ,
  `number` VARCHAR(45) NULL ,
  `type` ENUM('Home','Cell','Work','Other') NULL ,
  `inserted` DATETIME NULL ,
  `updated` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP ,
  PRIMARY KEY (`phone_number_id`) ,
  INDEX `fk_phone_number_person1` (`person_id` ASC) )
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
