Skip to content

Commit

Permalink
Weight column re-removal (#106)
Browse files Browse the repository at this point in the history
Properly drop weight column
  • Loading branch information
ArktinenKarpalo authored Mar 12, 2024
1 parent 9636d4f commit 638ffd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/db/migrations/20180217113920_prodgroup_rvitem.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ exports.up = async (knex) => {
.string('descr', 64)
.notNullable()
.comment('Textual product description (name)');
table
.integer('weight')
.unsigned()
.notNullable()
.comment('Product weight');
});
}
};
Expand Down
9 changes: 9 additions & 0 deletions src/db/migrations/20240309224600_weight_removal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports.up = async (knex) => {
await knex.raw('DROP VIEW "RVITEM"');
await knex.raw('ALTER TABLE "RVITEM_ALL" DROP COLUMN "weight"');
await knex.raw(
'CREATE VIEW "RVITEM" AS SELECT * FROM "RVITEM_ALL" WHERE deleted IS FALSE'
);
};

exports.down = async () => {};

0 comments on commit 638ffd0

Please sign in to comment.