/** * @param { import("knex").Knex } knex * @returns { Promise } */ 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 } */ exports.down = function(knex) { return knex.schema.dropTable('places'); };