mirror of
https://github.com/knex/knex.git
synced 2025-07-23 08:52:25 +00:00

* 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
15 lines
324 B
JavaScript
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');
|
|
};
|