
exports.up = function(knex) {
  return knex.schema
    .createTable('roles', async function (table) {
      table.increments('id');
      table.string('name');
      table.boolean('isDepartment');
    })
    .then(async () => {
      await knex('roles').insert({"name":"Administrator"}),
      await knex('roles').insert({"name":"Plant"}),
      await knex('roles').insert({"name":"Engineering"})
    })
};

exports.down = function(knex) {
  return knex.schema
    .dropTable('roles')
};
