This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/api/src/database/migrations/1723204419777_create_users_table.ts

22 lines
651 B
TypeScript
Raw Normal View History

2024-08-09 23:51:41 +02:00
import { BaseSchema } from "@adonisjs/lucid/schema"
export default class CreateUsersTable extends BaseSchema {
protected tableName = "users"
public override async up(): Promise<void> {
2024-08-10 02:32:34 +02:00
void this.schema.createTable(this.tableName, (table) => {
2024-08-09 23:51:41 +02:00
table.increments("id").notNullable()
table.string("full_name").nullable()
table.string("email", 254).notNullable().unique()
table.string("password").notNullable()
table.timestamp("created_at").notNullable()
table.timestamp("updated_at").nullable()
})
}
public override async down(): Promise<void> {
2024-08-10 02:32:34 +02:00
void this.schema.dropTable(this.tableName)
2024-08-09 23:51:41 +02:00
}
}