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

fix(graphql-migrations): migration failed for auto increments column #2071

Merged

Conversation

craicoverflow
Copy link

@craicoverflow craicoverflow commented Sep 17, 2020

Fixes #2047

Could not add a unit test for this because it is only a Postgres issue - we do need to think about integration tests for this scenario but due to it being a blocker we should get it merged and release first.

@craicoverflow craicoverflow force-pushed the fix/id-migrations-issue branch 2 times, most recently from cb5763a to 1683a64 Compare Sep 17, 2020
@craicoverflow craicoverflow requested review from machi1990 and wtrocki Sep 17, 2020
@machi1990
Copy link
Contributor

machi1990 commented Sep 17, 2020

I've added one comment. I'll properly test this tomorrow.

Copy link
Contributor

@machi1990 machi1990 left a comment

I've added one comment. I'll properly test this tomorrow.

I am still seeing the error

alter table "public"."note" alter column "_id" drop not null - column "_id" is in a primary key

I used the postgres templates.

I guess it might be the fact that the the column in database has a default value while the parsed column from the schema does not. This does not go well with the diff computation.

@craicoverflow
Copy link
Author

craicoverflow commented Sep 18, 2020

I am still seeing the error

Weird, you have run yarn build?

@machi1990
Copy link
Contributor

machi1990 commented Sep 18, 2020

I am still seeing the error

Weird, you have run yarn build?

Yes.

@craicoverflow craicoverflow force-pushed the fix/id-migrations-issue branch 2 times, most recently from 748f0c1 to 83a80cd Compare Sep 18, 2020
Migrations failed if the field was not "id" and the scalar was "ID"
@craicoverflow craicoverflow requested a review from machi1990 Sep 18, 2020
@machi1990
Copy link
Contributor

machi1990 commented Sep 18, 2020

I've added one comment. I'll properly test this tomorrow.

I am still seeing the error

alter table "public"."note" alter column "_id" drop not null - column "_id" is in a primary key

I used the postgres templates.

I guess it might be the fact that the the column in database has a default value while the parsed column from the schema does not. This does not go well with the diff computation.

I was testing the first patch and forgot to rebase over the latest change you've made today. This seems to be no longer the issue and the PR fixes the problem. Thanks for driving this baby home :-)

@craicoverflow craicoverflow merged commit e81d9bd into aerogear:master Sep 18, 2020
@craicoverflow craicoverflow deleted the fix/id-migrations-issue branch Sep 18, 2020
@craicoverflow craicoverflow added the bug Something isn't working label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graphql-migrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Second database migration throws an error
2 participants