Skip to content

Commit 23c30c2

Browse files
mukeshkphp-coder
authored andcommitted
fix(series-import): DataIntegrityViolationException when a URL longer than 255 characters.
Mismatch in columns length of series_import_requests.url and series_sales.transaction_url caused DataIntegrityViolationException. Fixed by adjusting their column lengths. Fix #990
1 parent 891667c commit 23c30c2

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

src/main/java/ru/mystamps/web/feature/series/sale/SeriesSalesDb.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
final class SeriesSalesDb {
2222

2323
static final class SeriesSales {
24-
static final int TRANSACTION_URL_LENGTH = 255;
24+
static final int TRANSACTION_URL_LENGTH = 767;
2525
}
2626

2727
}

src/main/resources/liquibase/changelog.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<include file="initial-state.xml" relativeToChangelogFile="true" />
1212
<include file="version/0.3.xml" relativeToChangelogFile="true" />
1313
<include file="version/0.4.xml" relativeToChangelogFile="true" />
14-
14+
<include file="version/0.4.1.xml" relativeToChangelogFile="true" />
15+
1516
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
<include file="0.4.1/2019-07-21--series_sales_transaction_url_length.xml" relativeToChangelogFile="true"/>
9+
10+
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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="modify-series_sales-transaction_url-field" author="mukeshk" context="scheme">
9+
<comment>Must match to the series_import_requests.url field</comment>
10+
<modifyDataType tableName="series_sales" columnName="transaction_url" newDataType="VARCHAR(767)" />
11+
</changeSet>
12+
13+
</databaseChangeLog>

src/test/robotframework/series/sales/validation.robot

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Force Tags series sales validation
99
*** Test Cases ***
1010
Create series sale with too long url
1111
${letter}= Set Variable j
12-
Input Text id=url http://${letter * 255}
12+
Input Text id=url http://${letter * 767}
1313
Submit Form id=add-series-sales-form
14-
Element Text Should Be id=url.errors Value is greater than allowable maximum of 255 characters
14+
Element Text Should Be id=url.errors Value is greater than allowable maximum of 767 characters
1515

1616
Create series sale with invalid url
1717
Input Text id=url invalid-url

0 commit comments

Comments
 (0)