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

"The driver you are using does not support the new state management." #61

Open
domarp-j opened this issue Dec 29, 2020 · 4 comments
Open

Comments

@domarp-j
Copy link

domarp-j commented Dec 29, 2020

Hello,

I'm running an application that uses [email protected], which has [email protected] as a dependency.

Our compilation process for local devleopment runs two migrations: one set of base migrations to build our PostgreSQL schema, and another set of migrations under the scope dev to add some seed data to the database.

Before today, our migrations ran fine. However, we're now seeing the following message in our logs:

[WARN] The driver you are using does not support the new state management. Please raise an issue in the repository of your driver maintainer

Our data now fails to seed because the dev-scoped migration is running our base migrations a second time. Because the migrations already ran in the past, the second run fails and never gets to the seed migrations further down the line.

We did not update any packages. Is there something I am missing? I can provide additional data if requested.

Thanks!


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@wzrdtales
Copy link
Member

no nothing. the new beta tag was accidentially released instead of the stable branch and the new version checks the drivers for compatibility. This is nothing you will have to worry about, this functionality will be just skipped in the new version. There is nothing really blocking that is known until know that would raise an issue with the new version, so you could continue using it, but the last stable was 0.11.x.

the newest db-migrate-pg driver is compatible with the newest db-migrate version though. the major version bump was due to breaking the node js compatibility level. Before 1.x.x the db-migrate-pg driver still supported < 8 now it is only >= 8.

@wzrdtales
Copy link
Member

the behaviour you're describing later however sounds wrong

Our data now fails to seed because the dev-scoped migration is running our base migrations a second time. Because the migrations already ran in the past, the second run fails and never gets to the seed migrations further down the line.

what do you mean with it runs the base migrations a second time? Which commands did you issue?

@domarp-j
Copy link
Author

domarp-j commented Dec 29, 2020

@wzrdtales Ah that makes sense. We use Docker to run our application, postgres DB, and other services locally. As part of the build process for the application's container, we install db-migrate globally (in the image's Dockerfile). I hardcoded the version to v0.11.11, which fixed the seeding issue. Thank you!

what do you mean with it runs the base migrations a second time? Which commands did you issue?

When we spin up the Docker containers for our application and postgres DB, we do the following:

  • First, we run a set of base migrations with db-migrate up to run every migration under the migrations/ directory in our repo. These migrations set the schema for our postgres DB.
  • Once those migrations succeed, we run the migrations for a specific scope depending on the build context. In dev, we run db-migrate up:dev to run everything in the migrations/dev/ directory. These migrations add seed data necessary for local development.

When we build the application's Docker image and globally install the latest stable version of db-migrate (v0.11.11), the above migrations work as expected.

However, when we were unintentionally installing the latest beta version, we would see the "driver you are using does not support new state management" warning message, and db-migrate up:dev would run the base migrations again. The second base migration run would fail, and the seeding migration would never run as a result.

@wzrdtales
Copy link
Member

ok thanks for the information, I will try to reproduce this behaviour.

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

No branches or pull requests

2 participants