MySQL Forums
Forum List  »  Newbie

Re: ERROR: Error 1067: Invalid default value for 'date_created'
Posted by: Barry Galbraith
Date: September 14, 2014 08:27PM

CREATE TABLE IF NOT EXISTS `affablebean`.`customer_order` (
`idcustomer` TIMESTAMP NULL,
`amount` DECIMAL(6,2) UNSIGNED NOT NULL,
`date_created` TIMESTAMP NOT NULL,
`confirmation_number` INT UNSIGNED NOT NULL,
`customer_idcustomer` INT UNSIGNED NOT NULL,
PRIMARY KEY (`amount`),
INDEX `fk_customer_order_customer_idx` (`customer_idcustomer` ASC),
CONSTRAINT `fk_customer_order_customer1`
FOREIGN KEY (`customer_idcustomer`)
REFERENCES `affablebean`.`customer` (`idcustomer`)
ON DELETE NO ACTION;

PRIMARY KEY is unique.
Your table means that you can't have two orders that cost the same amount.
Probably NOT a good idea.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: ERROR: Error 1067: Invalid default value for 'date_created'
September 14, 2014 08:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.