Newer
Older
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class extends BaseSchema {
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name', 255).notNullable()
table.specificType('groups', 'text[]').notNullable()
table.string('password', 180)
table.boolean('is_sigma_user').notNullable()
table.boolean('is_admin').notNullable().defaultTo(false)
/**
* Uses timestampz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
})
}
public async down() {
this.schema.dropTable(this.tableName)
}
}