| 1234567891011121314151617181920212223 |
- import BaseSchema from '@ioc:Adonis/Lucid/Schema'
- export default class extends BaseSchema {
- protected tableName = 'memberships'
- public async up() {
- this.schema.createTable(this.tableName, (table) => {
- table.increments('id')
- /**
- * Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
- */
- table.datetime('created_at', { useTz: true })
- table.datetime('updated_at', { useTz: true })
- table.integer('user_id').notNullable()
- table.datetime('expire_at', { useTz: true })
- })
- }
- public async down() {
- this.schema.dropTable(this.tableName)
- }
- }
|