1740987471879_ocr_records.ts 687 B

123456789101112131415161718192021
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'ocr_records'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.increments('id')
  7. table.string('device_id').notNullable()
  8. table.text('record').notNullable()
  9. table.string('channel').notNullable()
  10. table.string('img').notNullable()
  11. table.timestamp('updated_at', { useTz: true })
  12. table.timestamp('created_at', { useTz: true }).defaultTo(this.now())
  13. })
  14. }
  15. public async down() {
  16. this.schema.dropTable(this.tableName)
  17. }
  18. }