You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQLAlchemy gives us the option of defining the naming convention for certain constraints. For some databases, like SQL Server, this is essential because the generated constraint names can be difficult to figure out later in migrations.
The difficulty in keg apps at the moment is that assigning that naming convention properly requires a rather invasive modification to app setup. The assignment really has to happen before https://github.com/level12/keg/blob/master/keg/db/__init__.py#L69 runs and loads all the models into metadata. So, we're left with either
overriding the db manager class for a simple metadata attribute assignment
overriding init_db or init_extensions in the app itself
It would be better to have a setting for naming convention, which could then be applied automatically as something like keg.db.db.metadata.naming_convention = convention. Perhaps tie it to the dialect opts somehow, to support different conventions in the case that multiple dbs are bound.
The text was updated successfully, but these errors were encountered:
SQLAlchemy gives us the option of defining the naming convention for certain constraints. For some databases, like SQL Server, this is essential because the generated constraint names can be difficult to figure out later in migrations.
The difficulty in keg apps at the moment is that assigning that naming convention properly requires a rather invasive modification to app setup. The assignment really has to happen before https://github.com/level12/keg/blob/master/keg/db/__init__.py#L69 runs and loads all the models into metadata. So, we're left with either
It would be better to have a setting for naming convention, which could then be applied automatically as something like
keg.db.db.metadata.naming_convention = convention
. Perhaps tie it to the dialect opts somehow, to support different conventions in the case that multiple dbs are bound.The text was updated successfully, but these errors were encountered: