Jump to content
Larry Ullman's Book Forums

Can't Create 'orders' Table


Recommended Posts

Hello forum

 

In chapter 3, I'm  having a hard time creating the 'orders' table, I get this message:

 

ERROR 1005 (HY000): Can't create table 'ecommerce1.orders' (errno: 150)

 

I believe I'm typing everthing correctly, anyone else having the some issue?

Link to comment
Share on other sites

Thanks, problem fixed.

 

I also got this message in the users table:

ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

 

To solve that I used TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP in the date_created field and TIMESTAMP in date_modified

 

Any comments?

Link to comment
Share on other sites

  • 8 months later...

hi all,

 

I am a newbie to database designing & web programming.

 

In 'orders' table, the FK constraint clause is as follows.

 

CONSTRAINT `fk_orders_user1` FOREIGN KEY(`id`)

REFERENCES `users`(`id`)

 

Is it a typo? Because in 'orders' table if the 'users_id' is foreign key then the FK constraint clause should have been as follows.

 

CONSTRAINT `fk_orders_user1` FOREIGN KEY(`users_id`)

REFERENCES `users`(`id`) 

 

Am i right folks?

 

regards

Sachin Raut

Link to comment
Share on other sites

 Share

×
×
  • Create New...