Skip to content

Commit

Permalink
Merge pull request #131 from story-squad/fix/host-choice
Browse files Browse the repository at this point in the history
add migration to alter host-choices table
  • Loading branch information
trevorjamesmartin authored Apr 4, 2021
2 parents 3b25fed + 6fb56f8 commit 0b1420e
Show file tree
Hide file tree
Showing 201 changed files with 98 additions and 2,808 deletions.
21 changes: 21 additions & 0 deletions data/migrations/20210404183408_host-choices-upgrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
exports.up = function (knex) {
return knex.schema.alterTable("host-choices", function (tbl) {
// remove not-nullable from host
tbl.integer("word_id_one").nullable().alter();
tbl.integer("word_id_two").nullable().alter();
// remove foreign-key constraints
tbl.dropForeign("word_id_one");
tbl.dropForeign("word_id_two");
});
};

exports.down = function (knex) {
return knex.schema.alterTable("host-choices", function (tbl) {
// add not-nullable from host
tbl.integer("word_id_one").notNullable().alter();
tbl.integer("word_id_two").notNullable().alter();
// add foreign-key constraints
tbl.integer("word_id_one").references("words.id").alter();
tbl.integer("word_id_two").references("words.id").alter();
});
};
21 changes: 21 additions & 0 deletions dist/data/migrations/20210404183408_host-choices-upgrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
exports.up = function (knex) {
return knex.schema.alterTable("host-choices", function (tbl) {
// remove not-nullable from host
tbl.integer("word_id_one").nullable().alter();
tbl.integer("word_id_two").nullable().alter();
// remove foreign-key constraints
tbl.dropForeign("word_id_one");
tbl.dropForeign("word_id_two");
});
};

exports.down = function (knex) {
return knex.schema.alterTable("host-choices", function (tbl) {
// add not-nullable from host
tbl.integer("word_id_one").notNullable().alter();
tbl.integer("word_id_two").notNullable().alter();
// add foreign-key constraints
tbl.integer("word_id_one").references("words.id").alter();
tbl.integer("word_id_two").references("words.id").alter();
});
};
Empty file removed dist/src/docs/.nojekyll
Empty file.
1 change: 0 additions & 1 deletion dist/src/docs/0146db89.517e0dc4.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/docs/01a85c17.97751ee2.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/docs/03c4432f.46623179.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/docs/0a790212.bb2ae28c.js

This file was deleted.

Loading

0 comments on commit 0b1420e

Please sign in to comment.