Igor Savin 1b39d67550
Tests for drop-and-recreate with async/await (#3083)
* Add test for drop-and-recreate with async/await

* Add some tests with schema

* Use correct migrations

* Add tests with promise chains for comparison

* Fix migration

* Fix Node 6 compatibility
2019-03-05 01:03:51 +01:00

15 lines
407 B
JavaScript

exports.up = async (knex) => {
await knex.raw('CREATE SCHEMA dummy_schema');
await knex.schema
.withSchema('dummy_schema')
.createTable('old_users', (table) => {
table.string('name');
table.string('officeId');
});
};
exports.down = async (knex) => {
await knex.schema.withSchema('dummy_schema').dropTable('old_users');
await knex.raw('DROP SCHEMA dummy_schema CASCADE');
};