Now logging visits to shorturls
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
|
||||
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');
|
||||
table.primary(['shortcode', 'timestamp']);
|
||||
table.foreign('shortcode').references('shortcode').inTable('urls');
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user