Skip to content

Commit 314c486

Browse files
committed
Series sales form: don't set second currency to USD if price isn't specified.
Fix #675
1 parent 48ebaaf commit 314c486

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Diff for: src/main/resources/liquibase/version/0.4.xml

+1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<include file="0.4/2017-05-29--test_image.xml" relativeToChangelogFile="true" />
3131
<include file="0.4/2017-10-23--image_filename.xml" relativeToChangelogFile="true" />
3232
<include file="0.4/2017-10-30--scott_code_length.xml" relativeToChangelogFile="true" />
33+
<include file="0.4/2017-10-31--series_sales_null_second_currency.xml" relativeToChangelogFile="true" />
3334

3435
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
7+
8+
<changeSet id="nullify-series_sales-second_currency" author="php-coder" context="prod-data">
9+
<comment>Sets to NULL the second_currency field if the second_price isn't specified</comment>
10+
11+
<!-- Be caution: there is no rollback! -->
12+
<sql>
13+
UPDATE series_sales
14+
SET second_currency = NULL
15+
WHERE second_price IS NULL AND second_currency IS NOT NULL
16+
</sql>
17+
18+
</changeSet>
19+
20+
</databaseChangeLog>

Diff for: src/main/webapp/WEB-INF/views/series/info.html

+1
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ <h5 th:text="|#{t_add_info_who_selling_series}:|">Add info about selling/buying
478478
</div>
479479
<div class="col-xs-4 no-padding">
480480
<select id="alt-currency" class="form-control" th:field="*{altCurrency}">
481+
<option value=""></option>
481482
<option value="USD">USD</option>
482483
<option value="EUR">EUR</option>
483484
<option value="GBP">GBP</option>

0 commit comments

Comments
 (0)