Skip to content

Commit 0131f32

Browse files
committed
chore: make series quantity to match their id.
Using series quantity looks more stable than id that is generated by database and can't be fully reliable.
1 parent 1721dad commit 0131f32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/resources/liquibase/version/0.4.1/2019-08-06--test_user_with_series_in_collection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</insert>
3333

3434
<insert tableName="series">
35-
<column name="quantity" valueNumeric="5" />
35+
<column name="quantity" valueNumeric="3" />
3636
<column name="perforated" valueBoolean="TRUE" />
3737
<column name="category_id" valueNumeric="1" />
3838
<column name="created_at" valueComputed="${NOW}" />
@@ -43,7 +43,7 @@
4343

4444
<insert tableName="collections_series">
4545
<column name="collection_id" valueComputed="(SELECT id FROM collections WHERE slug = 'seriesowner')" />
46-
<column name="series_id" valueNumeric="3" />
46+
<column name="series_id" valueComputed="(SELECT id FROM series WHERE quantity = 3 ORDER BY id LIMIT 1)" />
4747
<column name="number_of_stamps" valueNumeric="3" />
4848
</insert>
4949
</changeSet>

src/main/resources/liquibase/version/0.4/2017-11-08--import_series.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<changeSet id="add-another-test-series" author="php-coder" context="test-data">
135135

136136
<insert tableName="series">
137-
<column name="quantity" valueNumeric="3" />
137+
<column name="quantity" valueNumeric="2" />
138138
<column name="perforated" valueBoolean="false" />
139139
<column name="category_id" valueNumeric="1" />
140140
<column name="country_id" valueNumeric="1" />
@@ -146,7 +146,7 @@
146146
</insert>
147147

148148
<insert tableName="series_images">
149-
<column name="series_id" valueNumeric="2" />
149+
<column name="series_id" valueComputed="(SELECT id FROM series WHERE quantity = 2 ORDER BY id LIMIT 1)" />
150150
<column name="image_id" valueNumeric="1" />
151151
</insert>
152152

0 commit comments

Comments
 (0)