| 12345678910111213141516171819202122232425 |
- import BaseSchema from '@ioc:Adonis/Lucid/Schema'
- export default class extends BaseSchema {
- protected tableName = 'balance_records'
- public async up() {
- this.schema.createTable(this.tableName, (table) => {
- table.increments('id')
- table.timestamp('created_at', { useTz: true })
- table.timestamp('updated_at', { useTz: true })
- table.integer('user_id').notNullable()
- table.decimal('amount', 19, 6).notNullable()
- table.string('type').notNullable()
- table.string('description').nullable()
- table.decimal('balance', 19, 6).notNullable()
- table.decimal('last_balance', 19, 6).notNullable()
- table.integer('series_id').nullable()
- table.integer('episode_id').nullable()
- })
- }
- public async down() {
- this.schema.dropTable(this.tableName)
- }
- }
|