Igor Savin fe6083eda4 Support nullable timestamps on MySQL (#3100)
* Add test to recreate the issue

* Improve test, add some documentation

* Improve test

* Add explicit nullable flag to column

* Set nullability explicitly on MySQL to deal with timestamp edge case

* Use same assertion for everything
2019-03-30 15:58:56 +02:00

15 lines
324 B
JavaScript

exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.createTable('null_date', function(t) {
t.increments('id').primary();
t.timestamp('deleted_at')
.nullable()
.defaultTo(null);
}),
]);
};
exports.down = (knex) => {
return knex.schema.dropTable('null_date');
};