1700739735030_orders.ts 649 B

12345678910111213141516171819202122
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'orders'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.increments('id')
  7. table.timestamp('created_at', { useTz: true })
  8. table.timestamp('updated_at', { useTz: true })
  9. table.integer('user_id')
  10. table.integer('price')
  11. table.string('type')
  12. table.integer('series_id')
  13. table.integer('episode_id')
  14. })
  15. }
  16. public async down() {
  17. this.schema.dropTable(this.tableName)
  18. }
  19. }