Default DATETIME issues with SQL install (Links Manager)
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:
Code:
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
Code:
`links_date_added` datetime NOT NULL default '0000-00-00 00:00:00',
`links_last_modified` datetime default NULL
with
Code:
`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.
Re: Default DATETIME issues with SQL install (Links Manager)
Quote:
Originally Posted 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:
Code:
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 ;
What is the "trouble" you are having with this install sql?
btw: You need to change
TYPE = MYISAM
to
ENGINE = MYISAM
Re: Default DATETIME issues with SQL install (Links Manager)
Quote:
Originally Posted by
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
Code:
`links_date_added` datetime NOT NULL default '0000-00-00 00:00:00'
returns an error (as stated above).
I will experiment either with using TIMESTAMP or a TRIGGER instead and post results.
Re: Default DATETIME issues with SQL install (Links Manager)
I probably should have begun this discussion on the Links Manager support thread and will move the conversation there.