mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-22 07:52:29 +03:00
Merge pull request #522 from oxteam/oxteam-fix_gpdr_sql_backward_comp
Fix MySQL/MariaDB 5.5.x backward compatibility issue with 'ea_consents' table (#518)
This commit is contained in:
commit
bd45947a42
3 changed files with 5 additions and 4 deletions
|
@ -25,9 +25,9 @@ class Migration_Legal_contents extends CI_Migration {
|
|||
$this->db->query('
|
||||
CREATE TABLE IF NOT EXISTS `ea_consents` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`created` DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created` TIMESTAMP,
|
||||
`first_name` VARCHAR(256),
|
||||
`last_name` VARCHAR(256),
|
||||
`email` VARCHAR(512),
|
||||
|
|
|
@ -74,6 +74,7 @@ class Consents_model extends CI_Model {
|
|||
*/
|
||||
protected function _insert($consent)
|
||||
{
|
||||
$this->db->set('created', 'NOW()', FALSE);
|
||||
if ( ! $this->db->insert('ea_consents', $consent))
|
||||
{
|
||||
throw new Exception('Could not insert consent to the database.');
|
||||
|
|
|
@ -24,9 +24,9 @@ CREATE TABLE IF NOT EXISTS `ea_appointments` (
|
|||
|
||||
CREATE TABLE IF NOT EXISTS `ea_consents` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`created` DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created` TIMESTAMP,
|
||||
`first_name` VARCHAR(256),
|
||||
`last_name` VARCHAR(256),
|
||||
`email` VARCHAR(512),
|
||||
|
|
Loading…
Reference in a new issue