mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-03 15:07:33 +02:00
22 lines
664 B
TypeScript
22 lines
664 B
TypeScript
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'users'
|
|
|
|
public async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id').primary()
|
|
table.string('pseudo', 50).notNullable
|
|
table.string('email', 255).notNullable().unique()
|
|
table.string('password', 180).notNullable()
|
|
table.string('remember_me_token').nullable()
|
|
table.timestamp('created_at', { useTz: true }).notNullable()
|
|
table.timestamp('updated_at', { useTz: true }).notNullable()
|
|
})
|
|
}
|
|
|
|
public async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
}
|