seepur/database/migrations/1586374249535_call_schema.js
2020-04-12 10:25:42 -04:00

27 lines
597 B
JavaScript

'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();
table.bigInteger('user_1').notNullable();
table.bigInteger('user_2').notNullable();
table.bigInteger('child_id').notNullable();
table.timestamps();
table.index(['child_id']);
table.index(['user_1']);
table.index(['user_2']);
})
}
down() {
this.drop('calls');
}
}
module.exports = CallSchema;