fix: update migrations used in tests causing error

Signed-off-by: lpete@vmware.com <lpete@vmware.com>
This commit is contained in:
lpete@vmware.com
2023-08-09 23:40:39 -04:00
parent 02cedae992
commit 6e379187fa
4 changed files with 6 additions and 4 deletions
@@ -23,7 +23,7 @@ exports.up = async function up(knex) {
await knex.schema.createTable('metadata', table => {
table.comment('The table of Bazaar metadata');
table
.text('entity_ref')
.string('entity_ref')
.notNullable()
.unique()
.comment('The ref of the entity');
@@ -49,7 +49,7 @@ exports.up = async function up(knex) {
await knex.schema.createTable('members', table => {
table.comment('The table of Bazaar members');
table
.text('entity_ref')
.string('entity_ref')
.notNullable()
.references('metadata.entity_ref')
.onDelete('CASCADE')
@@ -89,9 +89,11 @@ exports.up = async function up(knex) {
await knex.schema.alterTable('members', table => {
table
.integer('item_id')
.unsigned()
.references('metadata.id')
.onDelete('CASCADE')
.comment('Id of the associated item');
table.dropForeign('entity_ref');
table.dropColumn('entity_ref');
});
}