Error on installation - TIMESTAMP defaults
Downloaded extension (v1.4), tried to install and got the following error:
`Cannot execute CREATE TABLE `civicrm_advimport` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Advimport ID',
`contact_id` int unsigned COMMENT 'FK to Contact, import author',
`classname` varchar(255) COMMENT 'Mapping helper class name',
`start_date` timestamp COMMENT 'Import start',
`end_date` timestamp COMMENT 'Import end',
`filename` varchar(255) COMMENT 'Name of the file uploaded',
`table_name` varchar(128) COMMENT 'SQL table where the data is staged before being processed',
`total_count` int unsigned COMMENT 'Total number of rows',
`success_count` int unsigned COMMENT 'Number of rows imported successful',
`warning_count` int unsigned COMMENT 'Number of rows imported with warnings',
`error_count` int unsigned COMMENT 'Number of rows that failed to import because of errors',
`track_entity_type` varchar(128) COMMENT 'Ex: group or tag used to track contacts imported',
`track_entity_id` int unsigned COMMENT 'ID of the group or tag used to track contacts imported',
`mapping` text COMMENT 'Field mapping' ,
PRIMARY KEY (`id`) ,
CONSTRAINT FK_civicrm_advimport_contact_id
FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL ) ENGINE=InnoDB: DB Error: unknown error`
Tried this in SQL and get:
Error Code: 1067. Invalid default value for 'end_date'
I had to use SET SQL_MODE='ALLOW_INVALID_DATES' in MySQL Workbench to get this to run. I then amended the SQL in the module to add a default so that it could install:
`start_date` timestamp NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT 'Import start',
`end_date` timestamp NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT 'Import end',
Not sure what you would like here, so just reporting.