1575322618141_organizations_schema.js
Home
/
database /
migrations /
1575322618141_organizations_schema.js
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class OrganizationsSchema extends Schema {
up () {
this.create('organizations', (table) => {
table.increments('id')
table.string('name').notNullable().unique()
table.string('email').notNullable()
table.string('phone').notNullable()
table.integer('organization_type_id').notNullable().references('id').inTable('organization_types')
table.timestamps()
})
}
down () {
this.drop('organizations')
}
}
module.exports = OrganizationsSchema