Skip to content

Commit

Permalink
Add liquibase script for swatch-contracts test
Browse files Browse the repository at this point in the history
PR #3237 introduced the SPECIAL_PRICING_FLAG to the offering table for the monolith, but we need to add a liquibase script specific for h2 databases so swatch-contracts integration test will be successful

Resolves exception

```
Caused by: org.hibernate.exception.SQLGrammarException: could not prepare statement [Column "SPECIAL_PRICING_FLAG" not found; SQL statement:
insert into offering (cores,derived_sku,description,has_unlimited_usage,hypervisor_cores,hypervisor_sockets,metered,product_family,product_name,role,sla,sockets,special_pricing_flag,usage,sku) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [42122-224]] [insert into offering (cores,derived_sku,description,has_unlimited_usage,hypervisor_cores,hypervisor_sockets,metered,product_family,product_name,role,sla,sockets,special_pricing_flag,usage,sku) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]
```
  • Loading branch information
lindseyburnett committed May 23, 2024
1 parent 349eb2d commit edd9506
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.20.xsd">
<changeSet id="202405222240-01" author="lburnett" dbms="h2">
<comment>Add SPECIAL_PRICING_FLAG column to the OFFERING table for tests only (since it is still
managed by the
monolith)
</comment>
<addColumn tableName="offering">
<column name="special_pricing_flag" type="VARCHAR(255)"/>
</addColumn>
<rollback>
<dropColumn tableName="offering" columnName="special_pricing_flag"/>
</rollback>
</changeSet>
</databaseChangeLog>


<!-- vim: set expandtab sts=4 sw=4 ai: -->

2 changes: 1 addition & 1 deletion swatch-contracts/src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<include file="db/202402151611_add_offering_sku_product_tag_h2_only.xml"/>
<include file="db/202402161401_fix_contract_product_for_rosa.xml"/>
<include file="db/202405031420_terminate_azure_testing_subscriptions.xml"/>

<include file="db/202405222240_add_offering_special_product_tag_h2_only.xml"/>
</databaseChangeLog>

0 comments on commit edd9506

Please sign in to comment.