fix: update migrations used in tests causing error
Signed-off-by: lpete@vmware.com <lpete@vmware.com>
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user