Skip to content

Commit

Permalink
migration to make opt_out.assignment_id nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
schuyler1d committed Aug 27, 2020
1 parent 377871a commit a6ab473
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions migrations/20200826173603_optout_assignmentid_null.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
exports.up = async knex => {
const isSqlite = /sqlite/.test(knex.client.config.client);
if (!isSqlite) {
await knex.schema.alterTable("opt_out", table => {
table
.integer("assignment_id")
.alter()
.nullable();
});
}
};

exports.down = async knex => {
const isSqlite = /sqlite/.test(knex.client.config.client);
if (!isSqlite) {
await knex.schema.alterTable("opt_out", table => {
table
.integer("assignment_id")
.alter()
.notNullable();
});
}
};

0 comments on commit a6ab473

Please sign in to comment.