Added index to shortcode for easier queriing
This commit is contained in:
parent
c4c22a7405
commit
08140742ed
@ -3,7 +3,7 @@ exports.up = function (knex) {
|
|||||||
return knex.schema.createTable('visits', function (table) {
|
return knex.schema.createTable('visits', function (table) {
|
||||||
table.increments('id').primary();
|
table.increments('id').primary();
|
||||||
table.timestamp('timestamp').defaultTo(knex.fn.now());
|
table.timestamp('timestamp').defaultTo(knex.fn.now());
|
||||||
table.string('shortcode');
|
table.string('shortcode').index();
|
||||||
table.foreign('shortcode').references('shortcode').inTable('urls');
|
table.foreign('shortcode').references('shortcode').inTable('urls');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user