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

Second database migration throws an error #2047

Closed
craicoverflow opened this issue Sep 14, 2020 · 4 comments · Fixed by #2071
Closed

Second database migration throws an error #2047

craicoverflow opened this issue Sep 14, 2020 · 4 comments · Fixed by #2071

Comments

@craicoverflow
Copy link

  • Module: graphql-migrations
  • Version: 0.16

This occurs when the primary key field is NOT "id" - it fails on uuid: ID, _id: ID etc.

> yarn develop
yarn run v1.22.5
$ ts-node src/index.ts
🚀  Server ready at http://localhost:4000/graphql
Migrated database
^C
> yarn develop
yarn run v1.22.5
$ ts-node src/index.ts
🚀  Server ready at http://localhost:4000/graphql
(node:71304) UnhandledPromiseRejectionWarning: error: alter table "public"."note" alter column "_id" drop not null - column "_id" is in a primary key
@machi1990
Copy link
Contributor

Automatically generated comment to notify maintainers
/cc @machi1990, @wtrocki

@craicoverflow
Copy link
Author

I think we need an automated test or unit test that covers consecutive migrations like this.

@machi1990
Copy link
Contributor

Looks like the diff algorithm needs some love :-)

@craicoverflow
Copy link
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants