nova/nova/db/api
Stephen Finucane 031eda5826 db: Replace use of backref
Per the SQLAlchemy docs [1]:

  The relationship.backref keyword should be considered legacy, and use
  of relationship.back_populates with explicit relationship() constructs
  should be preferred.

A number of the relationships defined here don't have foreign keys (long
live mordred?) so their conversion is slightly more difficult than would
otherwise be the case. A blog post is available to explain what's going
on [2] and might be worth a read. The learnings from that blog post do
have the benefit of allowing us to simplify some existing relationships
that had unnecessary arguments defined.

[1] https://docs.sqlalchemy.org/en/14/orm/backref.html
[2] https://that.guru/blog/sqlalchemy-relationships-without-foreign-keys/

Change-Id: I5a135b012dabdff7cf06204fc3c5438aaa0985c9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-09-13 13:17:27 +01:00
..
migrations Merge "db: Don't rely on branched connections" 2023-06-07 16:54:01 +00:00
__init__.py Add missing __init__.py in nova/db/api 2021-09-20 11:28:46 +02:00
alembic.ini db: Integrate alembic 2021-08-09 15:34:40 +01:00
api.py db: Post reshuffle cleanup 2021-08-09 15:34:40 +01:00
models.py db: Replace use of backref 2023-09-13 13:17:27 +01:00