Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

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

Merged

Conversation

craicoverflow
Copy link

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 September 17, 2020 16:32
@machi1990
Copy link
Contributor

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

Copy link
Contributor

@machi1990 machi1990 left a comment

Choose a reason for hiding this comment

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

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

I am still seeing the error

Weird, you have run yarn build?

@craicoverflow craicoverflow force-pushed the fix/id-migrations-issue branch from 1683a64 to f82f88c Compare September 18, 2020 08:20
@machi1990
Copy link
Contributor

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 September 18, 2020 09:57
Migrations failed if the field was not "id" and the scalar was "ID"
@machi1990
Copy link
Contributor

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 September 18, 2020 10:17
@craicoverflow craicoverflow added the bug Something isn't working label Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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