1741251032761_ocr_devices.ts 752 B

12345678910111213141516171819202122
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'ocr_devices'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.string('id', 70).primary()
  7. table.timestamp('updated_at', { useTz: true })
  8. table.timestamp('created_at', { useTz: true }).defaultTo(this.now())
  9. table.string('platform').notNullable()
  10. table.string('device_info').nullable()
  11. table.string('channel').notNullable()
  12. table.integer('total').defaultTo(0)
  13. table.integer('scanned').defaultTo(0)
  14. })
  15. }
  16. public async down() {
  17. this.schema.dropTable(this.tableName)
  18. }
  19. }