2020-04-12 14:25:42 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
/** @type {import('@adonisjs/lucid/src/Schema')} */
|
|
|
|
const Schema = use('Schema');
|
|
|
|
|
|
|
|
class CallSchema extends Schema {
|
|
|
|
up() {
|
|
|
|
this.create('calls', (table) => {
|
|
|
|
table.increments();
|
|
|
|
table.string('state').notNullable();
|
2020-04-28 03:04:09 +00:00
|
|
|
table.bigInteger('parent_id').notNullable();
|
|
|
|
table.bigInteger('guest_id').notNullable();
|
2020-04-12 14:25:42 +00:00
|
|
|
table.bigInteger('child_id').notNullable();
|
|
|
|
table.timestamps();
|
|
|
|
table.index(['child_id']);
|
2020-04-28 03:04:09 +00:00
|
|
|
table.index(['parent_id']);
|
|
|
|
table.index(['guest_id']);
|
2020-04-12 14:25:42 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
down() {
|
|
|
|
this.drop('calls');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = CallSchema;
|