2021-08-14 07:06:18 +00:00
|
|
|
|
|
|
|
exports.up = function (knex) {
|
2021-08-14 07:15:15 +00:00
|
|
|
return knex.schema.createTable('visits', function (table) {
|
2021-08-14 07:23:55 +00:00
|
|
|
table.increments('id').primary();
|
2021-08-14 07:15:15 +00:00
|
|
|
table.timestamp('timestamp').defaultTo(knex.fn.now());
|
2021-08-14 07:27:39 +00:00
|
|
|
table.string('shortcode').index();
|
2021-08-14 07:32:17 +00:00
|
|
|
table.foreign('shortcode').references('shortcode').inTable('urls').onDelete('CASCADE');
|
2021-08-14 07:06:18 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.down = function (knex) {
|
|
|
|
|
|
|
|
};
|