How to migrate naming convention? #906
-
https://github.com/sqlalchemy/sqlalchemy/discussions/7008 The same post in sqlalchemy. Will close both when solved in either post. question copied by mike: Up until now, I managed the database with anonymous constraints. And recently, I ran into situation when two foreign keys exist in the same table and alembic need a name to work correctly. So giving a naming convention seems the most recommended solution, but I think introducing the 'new rules' into existing database would definitively cause some troubles. Some constraints are not named as rules suggest, and alembic wouldn't find them correctly. Is there a correct procedure to introduce the naming convention amid? Should I just manually write a script to rename the legacy constraints? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
if you have a whole DB with anonymously named constraints and you now have two FKs that need names, I would not advise going with a naming convention unless you really wanted to get into that. for now, give these specific FKs an explicit name so that you can manage them directly without impacting your whole database schema. |
Beta Was this translation helpful? Give feedback.
if you have a whole DB with anonymously named constraints and you now have two FKs that need names, I would not advise going with a naming convention unless you really wanted to get into that. for now, give these specific FKs an explicit name so that you can manage them directly without impacting your whole database schema.