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

Consider finding a new tool for migrations #609

Closed
slifty opened this issue Nov 16, 2023 · 5 comments · Fixed by #611
Closed

Consider finding a new tool for migrations #609

slifty opened this issue Nov 16, 2023 · 5 comments · Fixed by #611

Comments

@slifty
Copy link
Member

slifty commented Nov 16, 2023

https://github.com/ThomWright/postgres-migrations seems to be a dead project. I have a PR to fix a bug that affects us which has been open for about 18 months: ThomWright/postgres-migrations#93

It also is not being kept up to date more generally / the last commit was made 2 years ago.

We might consider:

  1. Forking, merging the fix, and publishing on our own.
  2. Finding a different migration tool.
@slifty
Copy link
Member Author

slifty commented Nov 16, 2023

This is coming up now because graphile-worker creates its tables in a separate schema, and has a migrations table in that schema. The presence of a migrations table in ANY schema causes postgres-migrations to fail because it incorrectly thinks that its own migrations table exists (this is the bug I opened a PR to fix last year).

@slifty
Copy link
Member Author

slifty commented Nov 16, 2023

I opened ThomWright/postgres-migrations#108 just in case there's a chance we can help maintain upstream (which I think would be explicitly better than forking and maintaining our own version).

@bickelj
Copy link
Contributor

bickelj commented Nov 16, 2023

I have no objection to forking if you don't hear back soon. I guess the downside is integrating the fork, right? Either having to publish a newly-named fork to npm or to use a different integration mechanism from npm for this one library?

@jasonaowen
Copy link
Contributor

Darn, that is limiting!

A third option would be to explore the forks, and perhaps collaborate / contribute there. It looks like the @dzangolab/postgres-migrations repo has published to npm, and the zakpatterson/postgres-schema-migrations repo has a schema fix but is not (obviously?) on npm.

@slifty
Copy link
Member Author

slifty commented Nov 17, 2023

zakpatterson's library is probably a good bet -- and they also did respond to the original issue pointing out that they had a fork. I'm fine with it; I suppose the only real risk is that it might not be maintained in future... which is already the current state! I'll try making the swap today. If upstream ends up being interested in help maintaining we can cross that bridge (and I suspect zakpatterson might even be interested in joining that team)

slifty added a commit that referenced this issue Nov 17, 2023
The upstream copy of our postgres-migrations project has an issue where
it does not support postgres schemas, and if ANY schema has a migrations
table then migrations will fail.  This was frustrating for running
tests, but recently while looking into developing a job queue which
would require a separate schema it became a blocking issue.

Upstream also appears to no longer be maintained (the most recent commit
as of this writing was about 2 years ago, and the PR we opened to fix
the schema limitation has been open for around 18 months).

Fortunately there is a fork of the library designed specifically for
adding schema support.

This replaces the library with the modified version and also updates our
migration code to utilize the schema functionality.

Issue #609 Consider finding a new tool for migrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants