/** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function(knex) { return knex.schema .createTable('users', function (table) { table.uuid('id').primary().defaultTo(knex.raw(`gen_random_uuid()`)); table.string('first_name', 255).notNullable(); table.string('last_name', 255).notNullable(); table.string('email', 255).unique().notNullable(); table.timestamps(true, true); }) }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function(knex) { return knex.schema.dropTable('users'); };