1703489114163_properties.ts 588 B

1234567891011121314151617181920
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'properties'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.string('id', 72).primary()
  7. table.datetime('created_at', { useTz: true })
  8. table.datetime('updated_at', { useTz: true })
  9. table.string('name')
  10. table.string('value')
  11. table.string('type').nullable()
  12. })
  13. }
  14. public async down() {
  15. this.schema.dropTable(this.tableName)
  16. }
  17. }