If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Sideboxes / Default DATETIME issues with SQL install (Links Manager)

Default DATETIME issues with SQL install (Links Manager)

Started by mutinyzoo on 22 Jan 2014, 2:39 AM · Views: 1,579

Results 1 to 4 of 4
22 Jan 2014, 2:39 AM
#1
mutinyzoo avatar

mutinyzoo

New Zenner

Join Date:
Mar 2011
Location:
Pensacola, FL
Posts:
88
Plugin Contributions:
2

Post #1 by mutinyzoo

I am looking at Links Manager for use on a site, but am having trouble with the SQL install file, I believe in the following statement:

CREATE TABLE rnm_links(
`links_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`links_url` varchar( 255 ) default NULL ,
`links_reciprocal_url` varchar( 255 ) default NULL ,
`links_image_url` varchar( 255 ) default NULL ,
`links_contact_name` varchar( 64 ) default NULL ,
`links_contact_email` varchar( 96 ) default NULL ,
`links_date_added` datetime NOT NULL default '0000-00-00 00:00:00',
`links_last_modified` datetime default NULL ,
`links_status` tinyint( 1 ) NOT NULL default '1',
`links_clicked` int( 11 ) NOT NULL default '0',
PRIMARY KEY ( `links_id` ) ,
KEY `idx_links_date_added` ( `links_date_added` )
) TYPE = MYISAM ;

Found a stackoverflow thread and tried replacing

  `links_date_added` datetime NOT NULL default '0000-00-00 00:00:00',
`links_last_modified` datetime default NULL 

with

   `links_date_added`     DATETIME DEFAULT CURRENT_TIMESTAMP,
    `links_last_modified` DATETIME ON UPDATE CURRENT_TIMESTAMP

get "invalid default value" message.

Someone had recommended using a "trigger". I thought I'd reach out to the ZC community for any possible insight before resuming on the morrow.

22 Jan 2014, 3:19 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #2 by gilby

mutinyzoo:

I am looking at Links Manager for use on a site, but am having trouble with the SQL install file, I believe in the following statement:

CREATE TABLE rnm_links(
links_id int( 11 ) NOT NULL AUTO_INCREMENT ,
links_url varchar( 255 ) default NULL ,
links_reciprocal_url varchar( 255 ) default NULL ,
links_image_url varchar( 255 ) default NULL ,
links_contact_name varchar( 64 ) default NULL ,
links_contact_email varchar( 96 ) default NULL ,
links_date_added datetime NOT NULL default '0000-00-00 00:00:00',
links_last_modified datetime default NULL ,
links_status tinyint( 1 ) NOT NULL default '1',
links_clicked int( 11 ) NOT NULL default '0',
PRIMARY KEY ( links_id ) ,
KEY idx_links_date_added ( links_date_added )
) TYPE = MYISAM ;


btw: You need to change 
TYPE = MYISAM
to
 ENGINE = MYISAM
22 Jan 2014, 3:46 PM
#3
mutinyzoo avatar

mutinyzoo

New Zenner

Join Date:
Mar 2011
Location:
Pensacola, FL
Posts:
88
Plugin Contributions:
2

Post #3 by mutinyzoo

gilby:

What is the "trouble" you are having with this install sql?

btw: You need to change
TYPE = MYISAM
to
ENGINE = MYISAM

The trouble is that the SQL statement is not valid for MySQL 5.5, and the server I'm running on does not have 5.6. So ```
links_date_added datetime NOT NULL default '0000-00-00 00:00:00'


I will experiment either with using TIMESTAMP or a TRIGGER instead and post results.
22 Jan 2014, 4:55 PM
#4
mutinyzoo avatar

mutinyzoo

New Zenner

Join Date:
Mar 2011
Location:
Pensacola, FL
Posts:
88
Plugin Contributions:
2

Post #4 by mutinyzoo

I probably should have begun this discussion on the Links Manager support thread and will move the conversation there.