1700727015979_series.ts 831 B

12345678910111213141516171819202122232425
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'series'
  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.string('title').notNullable()
  10. table.string('description')
  11. table.string('cover')
  12. table.string('tags')
  13. table.timestamp('release_date', { useTz: true }).nullable()
  14. table.text('meta')
  15. table.integer('play_count').defaultTo(0)
  16. table.decimal('price', 19, 6).defaultTo(0)
  17. })
  18. }
  19. public async down() {
  20. this.schema.dropTable(this.tableName)
  21. }
  22. }