24 lines
618 B
JavaScript
24 lines
618 B
JavaScript
/**
|
|
* @param { import("knex").Knex } knex
|
|
* @returns { Promise<void> }
|
|
*/
|
|
exports.up = function(knex) {
|
|
|
|
return knex.schema
|
|
.createTable('places', function (table) {
|
|
table.uuid('id').primary().defaultTo(knex.raw(`gen_random_uuid()`));
|
|
table.string('name', 255).notNullable();
|
|
table.specificType('coordinates', 'GEOGRAPHY(Point, 4326)').notNullable();
|
|
table.string('externalId', 255);
|
|
table.timestamps(true, true);
|
|
})
|
|
};
|
|
|
|
/**
|
|
* @param { import("knex").Knex } knex
|
|
* @returns { Promise<void> }
|
|
*/
|
|
exports.down = function(knex) {
|
|
return knex.schema.dropTable('places');
|
|
};
|