Well you can get at the names that were used in the DB (using Inspector, or reflection) as well as the names that are in your metadata ([constraint for constraint in table.constraints for table in metadata.tables.values()], but as far as matching them up I'm not sure, it depends on what patterns you can find in the existing DB that you can use. maybe you can write a script that guesses, then it spits out a list of oldname->newname, then you can manually correct it.
On 7/2/14, 6:08 PM, Ken Lareau wrote: > So, in my ongoing quest to make my team's operations database far more > sane than it currently is, I want to fix all the constraint naming in > the database > to match the naming convention setting I have added to my SQLAlchemy > configuration for the database. I could of course go through each > table and > determine each by hand, but I was wondering if there was a less manual > (and error-prone) way to approach this, possibly via the autogeneration > feature? In case it matters, the database server is MySQL. > > -- > - Ken Lareau > > -- > You received this message because you are subscribed to the Google > Groups "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
