wikipedia-game-solver/apps/api/database/migrations/1723204419777_create_users_table.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

22 lines
657 B
TypeScript

import { BaseSchema } from "@adonisjs/lucid/schema"
export default class CreateUsersTable extends BaseSchema {
protected tableName = "users"
public override async up(): Promise<void> {
void this.schema.createTable(this.tableName, (table) => {
table.increments("id").notNullable()
table.string("full_name").notNullable()
table.string("email", 254).notNullable().unique()
table.string("password").notNullable()
table.timestamp("created_at").notNullable()
table.timestamp("updated_at").notNullable()
})
}
public override async down(): Promise<void> {
void this.schema.dropTable(this.tableName)
}
}