auction-scrapper/database/migrations/1760511181894_create_create_users_table.ts
Vakula Uladimir 12f005e335 init
2025-10-17 11:27:52 +03:00

20 lines
619 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'users'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('email', 255).notNullable().unique()
table.string('password', 180).notNullable()
table.string('telegram_chat_id', 255).nullable().unique()
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}