Geo migration automatic DDL transactions are against the wrong database

The following discussion from !4719 (merged) should be addressed:

  • @nick.thomas commented on a discussion: (+4 comments)

    Argh, I suspect what's happening here is that the automatic DDL transaction is against ActiveRecord::Base rather than Geo::TrackingBase

    Let's leave this MR as-is, but we should have a ~"technical debt" issue to resolve this as it's very surprising.

I suspect this is what's happening, anyway.

By default, a migration is wrapped in a transaction. When performing SQL that needs to be run inside a transaction against the tracking database, we noted that the SQL complained it was not in a transaction.

Best theory: the automatic transaction is against ActiveRecord::Base rather than Geo::TrackingBase, and so completely the wrong database.

We should fix this so that the automatic transactions can successfully roll back partially applied migrations on the tracking DB.

Edited Sep 25, 2018 by Rachel Nienaber
Assignee Loading
Time tracking Loading