Anvil Community Forum

[Beta] Migrating Databases issues

In a trial run of this functionality:

  1. I initially found the direction of the arrows in the “big blue buttons” confusing. I clicked on the button pointing to the correct, updated schema (whereas the intention seems to be that the arrow points in the direction of the migration?).

  2. The auto-migration suggested was wrong–that is, different from what I intended. I had renamed one column and deleted a second column. The migration proposed deleting both columns and creating a new one (which would wrongly destroy the data in the renamed column).

My suggestion would be to not try to auto-migrate: no big blue buttons. Just draw attention to the conflict between the schema the code expects and the database schema, leaving it to the developer to make the necessary corrections to either code or database.

  1. I also found it confusing that switching to editing the production branch in the “Version History” dialog did not switch the current database to the production database associated with that branch in Environments. Rather, in order to see the IDE’s warning about the schema conflict between new code merged into production and the production database, I had to manually tell the IDE to “Use for Development” the production database. (edit: I guess what I’m requesting here is to be able to load an Environment other than the Debug Environment into the IDE.)
1 Like

Continuing the discussion from Sneaky Anvil Updates; in particular this image:

Although I have not used the Beta IDE yet, it seems that the wording above is both incorrect and misleading. Specifically, “your app” and “the app” is grossly incorrect and misleading when “your app” can (very sensibly) have multiple environments, each with its own database and database schema.

As I understand it, the above mismatch is not with “the” app as a whole, but between two specific environments within it. I believe that this is a situation where explicit is much better than implicit.