 -- MySQL Workbench Synchronization
--- Generated: 2015-04-13 16:25
+-- Generated: 2015-04-23 10:44
 -- Model: New Model
 -- Version: 1.0
 -- Project: Name of the project

  `ProductPrice` FLOAT(11) NOT NULL,
  `Quantity` INT(11) NOT NULL,
  `Discount` FLOAT(11) NOT NULL,
  `Active` TINYINT(1) NOT NULL,
  INDEX `fk_OrderDetail_Order1_idx` (`OrderId` ASC),
  INDEX `fk_OrderDetail_Product1_idx` (`ProductId` ASC),
  CONSTRAINT `fk_OrderDetail_Order1`


CREATE TABLE IF NOT EXISTS `UserAccount` (
  `Id` INT(11) NOT NULL AUTO_INCREMENT,
  `UserName` INT(11) NOT NULL,
  `Password` VARCHAR(20) NOT NULL,
  `Avatar` VARCHAR(60) NULL DEFAULT NULL,
  `DOB` DATE NULL DEFAULT NULL,
  `Gender` ENUM('Male', 'Female', 'Other') NOT NULL,
  `OrderList` VARCHAR(45) NULL DEFAULT NULL,
  `PasswordResetToken` CHAR(32) NULL DEFAULT NULL,
  `CreatedAt` DATETIME NOT NULL,
  `UpdatedAt` DATETIME NULL DEFAULT NULL,
  `Status` TINYINT(4) NOT NULL DEFAULT 1,
  `AddressId` INT(11) NOT NULL,
  PRIMARY KEY (`Id`),
  INDEX `fk_UserAccount_Address1_idx` (`AddressId` ASC),
  CONSTRAINT `fk_UserAccount_Address1`
    FOREIGN KEY (`AddressId`)
    REFERENCES `Address` (`Id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;

CREATE TABLE IF NOT EXISTS `User` (
  `Id` INT(11) NOT NULL AUTO_INCREMENT,
  `FullName` VARCHAR(100) NOT NULL,
  `Email` VARCHAR(100) NOT NULL,
  `PhoneNumber` CHAR(11) NOT NULL,
  `UserAccountId` INT(11) NULL DEFAULT NULL,
  PRIMARY KEY (`Id`),
  INDEX `fk_User_UserAccount_idx` (`UserAccountId` ASC),
  CONSTRAINT `fk_User_UserAccount`
    FOREIGN KEY (`UserAccountId`)
    REFERENCES `UserAccount` (`Id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
