)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e55e9c219d9a031ae732c41f4753813bf1cf48d7","unresolved":true,"context_lines":[{"line_number":7,"context_line":"db: Fold in ForeignKey constraints"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Yet another thing to ease the path of the alembic migration. Once again,"},{"line_number":10,"context_line":"there are some odd things here that require explanation. Firstly, we"},{"line_number":11,"context_line":"need to work around the fact that some foreign keys are named when using"},{"line_number":12,"context_line":"a MySQL or SQLite backend but not when using PostgreSQL. This is"},{"line_number":13,"context_line":"addressed via a custom compile rule [1] that simply drops the name"},{"line_number":14,"context_line":"argument for PostgreSQL, based on the assumption that we will not start"},{"line_number":15,"context_line":"naming these constraints going forward (this seems sane given we\u0027ve"},{"line_number":16,"context_line":"stopped doing it for MySQL and SQLite). I had initially attempted to"},{"line_number":17,"context_line":"solve this using dialect-specific keyword arguments, specifically, by"},{"line_number":18,"context_line":"using the \u0027argument_for\u0027 function [2] to add a \u0027mysql_name\u0027 parameter,"},{"line_number":19,"context_line":"but that doesn\u0027t seem to work as expected [3]. In addition to this, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"acdfd8ed_e4e3adfc","line":16,"range":{"start_line":10,"start_character":57,"end_line":16,"end_character":39},"updated":"2021-06-17 08:28:36.000000000","message":"✔","commit_id":"5819fe46a9bb0ee280cf3c46b11e77d260bc688c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e55e9c219d9a031ae732c41f4753813bf1cf48d7","unresolved":true,"context_lines":[{"line_number":16,"context_line":"stopped doing it for MySQL and SQLite). I had initially attempted to"},{"line_number":17,"context_line":"solve this using dialect-specific keyword arguments, specifically, by"},{"line_number":18,"context_line":"using the \u0027argument_for\u0027 function [2] to add a \u0027mysql_name\u0027 parameter,"},{"line_number":19,"context_line":"but that doesn\u0027t seem to work as expected [3]. In addition to this, the"},{"line_number":20,"context_line":"two foreign keys that were added without specific names ended up using"},{"line_number":21,"context_line":"the sqlalchemy-migrate derived names of \u0027%(table)s_%(firstcolumn)s_fkey\u0027"},{"line_number":22,"context_line":"[4] which we must replicate to prevent schema changes."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"[1] https://docs.sqlalchemy.org/en/14/core/compiler.html"},{"line_number":25,"context_line":"[2] https://docs.sqlalchemy.org/en/14/core/constraints.html#sqlalchemy.schema.ColumnCollectionConstraint.argument_for"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"6a82dd3f_7e96eb2b","line":22,"range":{"start_line":19,"start_character":47,"end_line":22,"end_character":54},"updated":"2021-06-17 08:28:36.000000000","message":"✔","commit_id":"5819fe46a9bb0ee280cf3c46b11e77d260bc688c"}],"nova/db/sqlalchemy/migrate_repo/versions/402_train.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e55e9c219d9a031ae732c41f4753813bf1cf48d7","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    )"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# We explicitly name many of our foreignkeys for MySQL so they match Havana"},{"line_number":52,"context_line":"@compiler.compiles(sa.ForeignKeyConstraint, \u0027postgresql\u0027)"},{"line_number":53,"context_line":"def process(element, compiler, **kw):"},{"line_number":54,"context_line":"    element.name \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"5705c397_22f8fc84","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":75},"updated":"2021-06-17 08:28:36.000000000","message":"supernit - You don\u0027t really say why we have to drop these for postgresql however. Context would be useful to future reviewers.","commit_id":"5819fe46a9bb0ee280cf3c46b11e77d260bc688c"}]}
