34 lines
851 B
JavaScript
34 lines
851 B
JavaScript
exports.up = async function(knex) {
|
|
await knex.schema.alterTable('actors', (table) => {
|
|
table.string('date_of_birth_precision')
|
|
.notNullable()
|
|
.defaultTo('day');
|
|
|
|
table.string('date_of_death_precision')
|
|
.notNullable()
|
|
.defaultTo('day');
|
|
});
|
|
|
|
await knex.schema.alterTable('actors_profiles', (table) => {
|
|
table.string('date_of_birth_precision')
|
|
.notNullable()
|
|
.defaultTo('day');
|
|
|
|
table.string('date_of_death_precision')
|
|
.notNullable()
|
|
.defaultTo('day');
|
|
});
|
|
};
|
|
|
|
exports.down = async function(knex) {
|
|
await knex.schema.alterTable('actors', (table) => {
|
|
table.dropColumn('date_of_birth_precision');
|
|
table.dropColumn('date_of_death_precision');
|
|
});
|
|
|
|
await knex.schema.alterTable('actors_profiles', (table) => {
|
|
table.dropColumn('date_of_birth_precision');
|
|
table.dropColumn('date_of_death_precision');
|
|
});
|
|
};
|