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

Diff repeatedly creates identical migrations for functions #29

Open
kjcsb1 opened this issue Mar 31, 2023 · 2 comments
Open

Diff repeatedly creates identical migrations for functions #29

kjcsb1 opened this issue Mar 31, 2023 · 2 comments
Labels
blocked Blocked by a dependency

Comments

@kjcsb1
Copy link

kjcsb1 commented Mar 31, 2023

I have a schema that has been diffed to create a migration. When I run the diff subsequently, the generated migration contains all of the function statements already contained in the original migration. This behaviour occurs repeatedly.

tusker --version
tusker 0.5.1

cat tusker.toml
[schema]
filename = "db/init/raytio_custom_db_entities/*.sql"

[migrations]
filename = "db/migrations/*.sql"

[database]
url = "postgresql://postgres:[email protected]:5432/postgres"

[migra]
safe = true
privileges = false

Steps to reproduce:

tusker --verbose diff > db/migrations/20230401_0817.sql
tusker --verbose diff > db/migrations/20230401_0818.sql
tusker --verbose diff > db/migrations/20230401_0819.sql

Note that 20230401_0818.sql and 20230401_0819.sql are identical files and contain all of the CREATE OR REPLACE FUNCTION statements already contained in 20230401_0817.sql

Possibly relevant: I get an SQLAlchemy warning when running the diff

RemovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings.  Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
  result = self.c.execute(*args, **kwargs)
@bikeshedder
Copy link
Owner

Tusker relies on migra for the actual diffing. Could you please report this issue on the migra issue tracker?

@danielnixon
Copy link

djrobstep/migra#222 looks related

@bikeshedder bikeshedder added the blocked Blocked by a dependency label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by a dependency
Projects
None yet
Development

No branches or pull requests

3 participants