1710684994129_memberships.ts 680 B

1234567891011121314151617181920212223
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'memberships'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.increments('id')
  7. /**
  8. * Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
  9. */
  10. table.datetime('created_at', { useTz: true })
  11. table.datetime('updated_at', { useTz: true })
  12. table.integer('user_id').notNullable()
  13. table.datetime('expire_at', { useTz: true })
  14. })
  15. }
  16. public async down() {
  17. this.schema.dropTable(this.tableName)
  18. }
  19. }