0a5b2d6 SQLAlchemy: add naming conventions

Authored and Committed by kparal 2 years ago
    SQLAlchemy: add naming conventions
    
    Without naming conventions, column constraints created with e.g. `unique=True`
    are not named, and therefore future edits of those constraints (or e.g. database
    downgrades) fail, unless you figure out the constraint name used in your
    particular database and add it into each new Alembic script.
    
    A better approach is to define a naming convention. SQLAlchemy then names all
    constraints according to this convention, and Alembic scripts work
    out-of-the-box even for constraint changes and downgrades. You can read more
    about it at:
    https://docs.sqlalchemy.org/en/14/core/constraints.html#configuring-constraint-naming-conventions
    
    This patch adds a default naming convention (as suggested by SQLAlchemy docs),
    and adds an Alembic script that performs a one-time rename of all affected
    constraints. Unique constraints were detected by Alembic's autogeneration
    feature, primary and foreign keys were renamed manually.
    
    Merges: https://pagure.io/fedora-qa/blockerbugs/pull-request/194
    
        
file modified
+11 -1
file modified
+1 -1