Skip to content

Commit

Permalink
OBPIH-3622 Insert audit dates in the migration of existing product pr…
Browse files Browse the repository at this point in the history
…ices
  • Loading branch information
awalkowiak committed Feb 25, 2021
1 parent 76e7bcf commit 1f6795a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@

<!-- migrate existing product_package.price into product_price -->
<changeSet author="awalkowiak" id="2601202111001-1">
<validCheckSum>4fd991a84d38876557d55ca24d5e360</validCheckSum>
<preConditions onFail="MARK_RAN">
<and>
<columnExists tableName="product_package" columnName="price"/>
<columnExists tableName="product_price" columnName="product_package_id"/>
</and>
</preConditions>
<sql>
INSERT INTO product_price (id, version, type, price, product_package_id)
SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package
INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
WHERE price IS NOT NULL AND price > 0;

UPDATE product_package
Expand Down

0 comments on commit 1f6795a

Please sign in to comment.