Skip to content

Series sale: extract and show series condition #1326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
php-coder opened this issue Apr 12, 2020 · 0 comments
Closed

Series sale: extract and show series condition #1326

php-coder opened this issue Apr 12, 2020 · 0 comments
Assignees
Labels
impact/changelog This change should be reflected in the NEWS.txt file kind/feature priority/important
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Apr 12, 2020

During series import and when admin adds a series sale, we should support to specify a series condition. The most frequently used is MNH. Others can be added later.

@php-coder php-coder added kind/feature impact/changelog This change should be reflected in the NEWS.txt file priority/important labels Apr 12, 2020
@php-coder php-coder added this to the 0.4.4 milestone Apr 12, 2020
@php-coder php-coder self-assigned this Apr 12, 2020
php-coder added a commit that referenced this issue May 4, 2020
php-coder added a commit that referenced this issue May 21, 2020
php-coder added a commit that referenced this issue May 21, 2020
Correction for 28eab06 commit.

Relate to #1326
php-coder added a commit that referenced this issue May 22, 2020
php-coder added a commit that referenced this issue May 22, 2020
"condition" is a reserved keyword in MySQL and  the queries were failing:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT
INTO series_sales ( series_id , date , seller_id , transaction_url , first_price , first_currency ,
second_price , second_currency , buyer_id , condition , created_at , created_by ) VALUES ( ?
, ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )]; nested exception is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version for the right syntax
to use near 'condition , created_at , created_by ) VALUES ( 9 , '2020-05-22 08:53:59.338' , 1' at
line 1

Correction for 28eab06 and 60a690c
commits.

Thanks to Pavel Finkelshtein <[email protected]> for the hint to use double quotes.

Address #1326
php-coder added a commit that referenced this issue May 22, 2020
php-coder added a commit that referenced this issue May 23, 2020
php-coder added a commit that referenced this issue May 23, 2020
…bases and unbreak integration tests.

I tried to use double quotes but it doesn't work on MySQL by default. We can activate it by setting
sql_mode to ANSI_QUOTES but I decided to give up on adding more workaround and just rename the
fields.

See for details:
- https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_ansi_quotes
- https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql
- https://stackoverflow.com/questions/58727070/how-to-dynamic-setting-sql-mode-for-mysql-in-springboot-program

Revert 74734a8 commit.
Correction for 28eab06 commit.

Relate to #1326
php-coder added a commit that referenced this issue May 25, 2020
php-coder added a commit that referenced this issue May 31, 2020
php-coder added a commit that referenced this issue Jun 3, 2020
php-coder added a commit that referenced this issue Jun 3, 2020
php-coder added a commit that referenced this issue Jun 20, 2020
php-coder added a commit that referenced this issue Jun 20, 2020
… H2 parameter.

Follow-up to c943447 commit.

Relate to #1326

[skip ci]
php-coder added a commit that referenced this issue Sep 8, 2022
…instead of the tables) comments

In the commit 89ba68c (#1326) I used <setColumnRemarks> in order to
put comments to the fields. It has turned out that on MySQL, Liquibase put comments on the tables
instead of the fields (see liquibase/liquibase#942). After update of
Liquibase (#1526), it became possible to fix the bug on our data.

Fix #1408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/changelog This change should be reflected in the NEWS.txt file kind/feature priority/important
Projects
None yet
Development

No branches or pull requests

1 participant