Files
zero-fucks-given/apps/backend/database/migrations/1784635200003_create_tenants_table.ts
2026-09-02 09:19:43 +03:00

21 lines
581 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'tenants'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.string('name').notNullable()
table.string('slug').notNullable().unique()
table.string('status').notNullable().defaultTo('active')
table.timestamp('created_at').notNullable().defaultTo(this.now())
table.timestamp('updated_at').nullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}