exports.up = function(knex) { return knex.schema.createTable('cities', function(cities) { cities.increments(); cities.string('name', 128).notNullable(); cities .integer('country_id') .unsigned() .notNullable() .references('id') .inTable('countries') .onDelete('CASCADE') .onUpdate('CASCADE'); }); }; exports.down = function(knex) { return knex.schema.dropTableIfExists('cities'); };