22 lines
653 B
TypeScript
22 lines
653 B
TypeScript
|
import { BaseSchema } from "@adonisjs/lucid/schema"
|
||
|
|
||
|
export default class CreateUsersTable extends BaseSchema {
|
||
|
protected tableName = "users"
|
||
|
|
||
|
public override async up(): Promise<void> {
|
||
|
await this.schema.createTable(this.tableName, (table) => {
|
||
|
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> {
|
||
|
await this.schema.dropTable(this.tableName)
|
||
|
}
|
||
|
}
|