import type { Knex } from 'knex' import { TablePK, TableName } from '../../api/models/db.model' export async function up(knex: Knex): Promise { return knex.schema.createTable(TableName.Users, (table) => { table.increments(TablePK.Users).primary().unique() table.string('xid').unique().notNullable() table.string('username').unique().notNullable() table.string('image_url').defaultTo(null) table.string('email').notNullable() table.string('password').notNullable() table.string('first_name').notNullable() table.string('last_name').notNullable() table.date('date_of_birth').notNullable() table.string('sex').notNullable() table.timestamp('activated_at').defaultTo(null) table.timestamp('deleted_at').defaultTo(null) table.timestamps(true, true) }) } export async function down(knex: Knex): Promise { return knex.schema.dropTable(TableName.Users) }