Order Table

CREATE TABLE IF NOT EXISTS `mydb`.`Order` (
  `idOrder` INT NOT NULL,
  `idUser` INT NOT NULL COMMENT 'Foreign Key',
  `idProducts` INT NOT NULL COMMENT 'Foreign Key',
  `OrderDate` DATE NOT NULL,
  `Quantity` INT NOT NULL,
  `AdjustedPrice` DECIMAL(6,2) NOT NULL,
  `AmountPaid` DECIMAL(6,2) NULL,
  `Approved` TINYINT(1) NULL,
  `Status` ENUM('New','ApprovedForProcurement','Ordered','RecievedInUS','Shipped','ReceivedInBelize','HeldForPayment','Complete') NULL COMMENT 'ENUM(\'New\',\'ApprovedForProcurement\',\'Ordered\',\'RecievedInUS\',\'Shipped\',\'ReceivedInBelize\',\'HeldForPayment\',\'Complete\')',
  `Comments` TEXT NULL,
  `CompletedDate` DATE NULL COMMENT 'Date given to Customer',
  PRIMARY KEY (`idOrder`),
  INDEX `fk_Orders_User1_idx` (`idUser` ASC),
  INDEX `fk_Orders_Products1_idx` (`idProducts` ASC),
  CONSTRAINT `fk_Orders_User1`
    FOREIGN KEY (`idUser`)
    REFERENCES `mydb`.`User` (`idUser`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_Orders_Products1`
    FOREIGN KEY (`idProducts`)
    REFERENCES `mydb`.`Product` (`idProducts`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
Topic revision: r1 - 2013-10-10 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback