diff --git a/back/src/database/migrations/20260911201457_user.ts b/back/src/database/migrations/20260911201457_user.ts index f8858f3..6298d37 100644 --- a/back/src/database/migrations/20260911201457_user.ts +++ b/back/src/database/migrations/20260911201457_user.ts @@ -2,11 +2,21 @@ import type { Knex } from "knex"; export async function up(knex: Knex): Promise { - -} + return knex.schema.createTable("users", (table) => { + table.increments("id").primary(); + table.uuid("public_id").notNullable().unique(); + table.string("name", 255).notNullable(); + table.string("email", 255).notNullable().unique(); + table.string("phone_number", 13).notNullable().unique(); + table.string("password", 255).notNullable(); + table.datetime("created_at").defaultTo(knex.fn.now()); + table.datetime("updated_at").nullable(); + }); +} export async function down(knex: Knex): Promise { -} + return knex.schema.dropTableIfExists("users"); +}