Linux Mint - Free and powerful

Monday, 30 March 2015

MySQL column type "TIMESTAMP" implicitly includes "NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" - Stack Overflow





Fck fck fck fck fckl fck. more expletives. arghhhhhhhhhh. Pull my hair out. Damn. Arghhhh. Fck fck fck fck fckl fck


http://stackoverflow.com/questions/22860351/mysql-column-type-timestamp-implicitly-includes-not-null-default-current-time

Are you migrating from a pre Mysql 5.6.* systems?



Chances are you will have CURRENT_TIMESTAMP. No matter what you do the import will fail.



1146 - Table 'blah blah blah' doesn't exist


select configuration_key as cfgKey, configuration_value as cfgValue from configuration


[TEP STOP]



You will pull your hair out. You will search and search and search. You will be frustrated.



Open up your massive 140mb SQL save file with Notepad++ or Gedit.



Find your failing table or search for timestamp.



create table oc_booking (

  ID int(11) unsigned not null auto_increment,

  Bookref varchar(10) not null ,

  Event_ID int(11) default '0' not null ,

  Attendee_ID int(11) default '0' not null ,

  Booking_made timestamp default 'CURRENT_TIMESTAMP' not null on update CURRENT_TIMESTAMP,

  PRIMARY KEY (ID)

);



Change it to:



create table oc_booking (

  ID int(11) unsigned not null auto_increment,

  Bookref varchar(10) not null ,

  Event_ID int(11) default '0' not null ,

  Attendee_ID int(11) default '0' not null ,

  Booking_made timestamp default 0,

  PRIMARY KEY (ID) 

);


Done. Breathe. Reset. Take a chill pill. Next challenge please.




0 comments :

Post a Comment

Thank you for taking the time to comment. Your opinion is important and of value and we appreciate the positive feedback! If you are "Negative Nancy" then please do us, and humanity, a favor, and piss off.

Total Pageviews

Google+ Followers

Pages

Blog Archive

Popular Posts

Recent Comments

Rays Twitter feed

Ads

Web sites come and go and information is lost and therefore some pages are archived. @rayd123. Powered by Blogger.