Skip to content
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

BUGFIX: PSQL Migration syntax fix #550

Merged
merged 2 commits into from
Sep 10, 2020
Merged

Conversation

gloriousCode
Copy link
Collaborator

PR Description

There was an issue migrating down using psql:

ERROR postgres.sql: failed to run SQL migration: failed to execute SQL query "ALTER TABLE withdrawal_history ALTER COLUMN exchange_name_id SET NULL;\n": pq: syntax error at or near "NULL"

Fixes a typo on migrations and also updates to use PSQL syntax

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested

.\dbmigrate.exe -command=up
.\dbmigrate.exe -command=down
Until it worked

@gloriousCode gloriousCode added bug review me This pull request is ready for review labels Sep 9, 2020
@gloriousCode gloriousCode self-assigned this Sep 9, 2020
@codecov
Copy link

codecov bot commented Sep 9, 2020

Codecov Report

Merging #550 into master will decrease coverage by 0.74%.
The diff coverage is 38.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
- Coverage   45.68%   44.93%   -0.75%     
==========================================
  Files         234      246      +12     
  Lines       56464    59411    +2947     
==========================================
+ Hits        25797    26699     +902     
- Misses      27875    29666    +1791     
- Partials     2792     3046     +254     
Impacted Files Coverage Δ
cmd/dbseed/candle.go 0.00% <0.00%> (ø)
cmd/dbseed/exchange.go 0.00% <0.00%> (ø)
cmd/dbseed/main.go 0.00% <0.00%> (ø)
config/config_types.go 0.00% <ø> (ø)
database/models/postgres/candle.go 0.00% <0.00%> (ø)
database/models/postgres/withdrawal_crypto.go 0.00% <ø> (ø)
database/models/postgres/withdrawal_fiat.go 0.00% <ø> (ø)
database/models/postgres/withdrawal_history.go 0.00% <0.00%> (-33.34%) ⬇️
database/models/sqlite3/withdrawal_crypto.go 53.66% <ø> (+0.99%) ⬆️
database/models/sqlite3/withdrawal_fiat.go 55.29% <ø> (ø)
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 091fade...f83384f. Read the comment docs.

Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

On master:

ERROR postgres.sql: failed to run SQL migration: failed to execute SQL query "ALTER TABLE candle ALTER COLUMN aseet SET NULL;\n": pq: syntax error at or near "NULL"

PR:
Connected to: localhost 2020/09/09 14:01:20 OK 20200814113829_update_withdrawal_history_add_not_null_to_exchange_name_id\postgres.sql

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 4 rules errored during the review.

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 4 rules errored during the review.

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Approved. Nice work!
Goosed it all the way down and all the way up, no issues.... no tissues needed.

Copy link
Contributor

@MadCozBadd MadCozBadd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACKKKK

@thrasher- thrasher- merged commit 16e3540 into thrasher-corp:master Sep 10, 2020
@gloriousCode gloriousCode deleted the asset branch November 9, 2021 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants