-
Notifications
You must be signed in to change notification settings - Fork 14
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
assure usability on multi DB development stack #69
Comments
This proposal is interesting. However I don't understand how this library will benefit projects that use SqlLite locally. No commands will be generated so what is the point of using it? |
You're correct, with this change this library will not generate its custom commands when making migrations based on a sqlite3 database, but that's important. The main point is that it should be possible to have this lib imported and still do migrations on an sqlite3. The needs and motivated outlined in this library helped me to easily:
however, since now I have a working migration I cannot generate new migrations based on sqlite3 (due to the error I mentioned in this issue's original text - the import and now there's a few options:
from these options, number 3 i think is the preferred solution, so i created this issue. with this change:
|
Good, I'll make this change |
Very happy to hear that :) when you have time, please also look into this quote of mine, as it would make the use of this lib as seamless as it is today but also for the my described use case, with backward compatibility aswell.
if you need anything else i'll be available! Thank you. |
There is new version |
Hi, Sorry for the delayed response. I can confirm that generating new migrations in any feedback on this?
edit: |
Sqlalchemy operations such as sa.Enum().create() will not do anything in dialects that do not have native enums |
Hi, thanks for making your project opensource.
Problem
To my knowledge
alembic-postgresql-enum
assumes that migrations are being generated by postgres, and independently of the source database, it issues postgres-specific queries to check for existing enums.This is relevant specially for the common
SQLite
in development, andpostgres
in staging/production workflow, where currently this library is not able to fill the same needs as it does currently for a standard development inpostgres
from local/development to production.currently, using this library it is not possible to generate simple migrations on a
SQLite
, that is compatible both forSQLite
andPostgres
. Its also not possible to turn off the hooks todispatch_for("schema")
.e.g. what happens when trying to generate new migrations having previously imported
alembic-postgresql-enum
- fromalembic_postgresql_enum/compare_dispatch.py
. obviously this query is only valid for postgres.Proposed solution
As I understand it (after a quick look),
is the entrypoint for the other hooks to alembic to check enums and modify enums.
as a simple solution for this library to not be code breaking after import, is to add a check for the dialect, i.e.
defined_enums.py
.it would also be relevant that migrations created using this library would be applied only if upgrading a postgres database (my code above doesn't solve this issue).
Final Statements
if this is in the interest of the mantainers, i would make myself available to generate a pull request.
thanks for reading, and my apologies for any mistakes or if not relevant for you.
The text was updated successfully, but these errors were encountered: