Closed Upperholme closed 5 years ago
What's the method for updating from version 2.0 to version 3.0? Normally i would delete the older version extension, unpack the new code into my extensions directory and refresh. Any DB upgrade then becomes apparent via the UI. In reality I'm getting an unknown fatal error which in the log appears to be linked to a foreign key check issue in the DB.
Here's the beginning of the very long log entry when trying to install version 3.0 on a database from which version 2.0 has been previously installed and then uninstalled:
$Fatal Error Details = array(3) {
["message"]=>
string(23) "DB Error: unknown error"
["code"]=>
NULL
["exception"]=>
object(CiviCRM_API3_Exception)#15623 (8) {
["extraParams":"CiviCRM_API3_Exception":private]=>
array(6) {
["error_code"]=>
string(13) "unknown error"
["sql"]=>
string(986) "CREATE TABLE IF NOT EXISTS civicrm_contact_push_notification_messages
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
contact_id
int(10) unsigned NOT NULL,
message
varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
entity_table
varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
entity_id
int(11) DEFAULT NULL,
send_date
datetime DEFAULT CURRENT_TIMESTAMP,
is_read
tinyint(4) DEFAULT '0',
PRIMARY KEY (id
),
KEY FK_civicrm_contact_push_notification_message
(contact_id
),
KEY INDEX_message
(message
),
KEY INDEX_entity_table
(entity_table
),
KEY INDEX_entity_record_id
(entity_id
),
KEY INDEX_send_date
(send_date
),
KEY INDEX_is_read
(is_read
),
CONSTRAINT FK_civicrm_contact_push_notification_message
FOREIGN KEY (contact_id
) REFERENCES civicrm_contact
(id
) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci [nativecode=1067 Invalid default value for 'send_date']"
["tip"]=>
string(62) "add debug=1 to your API call to have more info about the error"
["is_error"]=>
int(1)
["error_message"]=>
string(23) "DB Error: unknown error"
["debug_information"]=>
string(986) "CREATE TABLE IF NOT EXISTS civicrm_contact_push_notification_messages
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
contact_id
int(10) unsigned NOT NULL,
message
varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
entity_table
varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
entity_id
int(11) DEFAULT NULL,
send_date
datetime DEFAULT CURRENT_TIMESTAMP,
is_read
tinyint(4) DEFAULT '0',
PRIMARY KEY (id
),
KEY FK_civicrm_contact_push_notification_message
(contact_id
),
KEY INDEX_message
(message
),
KEY INDEX_entity_table
(entity_table
),
KEY INDEX_entity_record_id
(entity_id
),
KEY INDEX_send_date
(send_date
),
KEY INDEX_is_read
(is_read
),
CONSTRAINT FK_civicrm_contact_push_notification_message
FOREIGN KEY (contact_id
) REFERENCES civicrm_contact
(id
) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci [nativecode=1067 Invalid default value for 'send_date']"
}
["message":protected]=>
Running Civi 5.9.0 currently, with Wordpress.
As I've posted on the Stack Exchange site: https://civicrm.stackexchange.com/questions/30408/how-can-i-update-the-civimobile-2-0-extension-to-the-civimobileapi-3-0-extension/30413#30413
It looks like this is due to my use of an older version of MySQL. If I change the column type to TIMESTAMP will this break the extension?
Dear @Upperholme , we have already updated CiviMobile App extension and CiviMobile App with the latest fixes. So, please download the latest version and try it.
Hi @Upperholme , can you try new version https://github.com/agiliway/com.agiliway.civimobileapi/releases/tag/v3.1 ? Should works now.
I'm going to close the issue, If you still have troubles please reopen it.
I've got version 2.0 of this extension installed on a site that I manage. It's not reporting that a more recent release is available.