1584139902145_modify_submission_dates_nullable_schema.js
Home
/
database /
migrations /
1584139902145_modify_submission_dates_nullable_schema.js
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class ModifySubmissionDatesNullableSchema extends Schema {
up () {
this.alter('submissions', (table) => {
// alter table
table.date('upload_date').nullable().alter()
table.date('creation_date').nullable().alter()
table.date('published_date').nullable().alter()
})
}
down () {
this.alter('submissions', (table) => {
// reverse alternations
table.date('upload_date').notNullable().alter()
table.date('creation_date').notNullable().alter()
table.date('published_date').notNullable().alter()
})
}
}
module.exports = ModifySubmissionDatesNullableSchema