1702024124942_banners.ts 652 B

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