14 lines
389 B
JavaScript
14 lines
389 B
JavaScript
|
|
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) {
|
|
|
|
};
|