exports.up = function (knex) { return knex.schema.createTable('visits', function (table) { table.increments('id').primary(); table.timestamp('timestamp').defaultTo(knex.fn.now()); table.string('shortcode').index(); table.foreign('shortcode').references('shortcode').inTable('urls').onDelete('CASCADE'); }); }; exports.down = function (knex) { };