diff --git a/mixin/lib/civimix-schema/src/SqlGenerator.php b/mixin/lib/civimix-schema/src/SqlGenerator.php index ebd7f2fef9c0..c177abdb55f1 100644 --- a/mixin/lib/civimix-schema/src/SqlGenerator.php +++ b/mixin/lib/civimix-schema/src/SqlGenerator.php @@ -95,6 +95,10 @@ private function generateCreateTableSql(array $entity): string { if (!empty($field['required'])) { $fieldSql .= ' NOT NULL'; } + // Mysql 5.7 requires timestamp to be explicitly declared NULL + if (empty($field['required']) && $field['sql_type'] === 'timestamp') { + $fieldSql .= ' NULL'; + } if (!empty($field['auto_increment'])) { $fieldSql .= " AUTO_INCREMENT"; }