Merge pull request #969 from juampynr/fix-mysql-5.7

Fix invalid timestamp default values for MySQL 5.7
This commit is contained in:
Jim LAURIE 2018-04-23 12:29:15 +02:00 committed by GitHub
commit 21ed0156a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -34,8 +34,8 @@ module.exports = async cb => {
size text,
url text,
provider text,
updated_at ${Model.client === 'pg' ? 'timestamp with time zone' : 'timestamp'},
created_at ${Model.client === 'pg' ? 'timestamp with time zone' : 'timestamp'}
updated_at ${Model.client === 'pg' ? 'timestamp with time zone' : 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'},
created_at ${Model.client === 'pg' ? 'timestamp with time zone' : 'timestamp DEFAULT CURRENT_TIMESTAMP'}
);
CREATE TABLE ${quote}upload_file_morph${quote} (

View File

@ -460,8 +460,8 @@ CREATE TABLE ${quote}${details[currentModel].tableName}${quote} (
role ${details[currentModel].client === 'pg' ? 'integer' : 'int'},
${quote}resetPasswordToken${quote} text,
password text,
updated_at ${details[currentModel].client === 'pg' ? 'timestamp with time zone' : 'timestamp'},
created_at ${details[currentModel].client === 'pg' ? 'timestamp with time zone' : 'timestamp'}
updated_at ${details[currentModel].client === 'pg' ? 'timestamp with time zone' : 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'},
created_at ${details[currentModel].client === 'pg' ? 'timestamp with time zone' : 'timestamp DEFAULT CURRENT_TIMESTAMP'}
);`);
break;
case 'role':