blakus/apps/blakus-api/migrations/20250304134127_initial.js
Broks Randolfs Gailītis 1c2d245f7c
Some checks failed
CI / main (push) Failing after 4m54s
Initial places and map implementation
2025-03-15 12:52:17 +02:00

24 lines
611 B
JavaScript

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