Retool Database Schema Migration detects unnecessary changes for auto incrementing integers

Hey there,

I created a Retool Database Table in the production environment, successfully migrated to staging environment. The table schemas are identical.

Now when I test migrating schema back from staging -> production, I get unnecessary changes detected:

When I try to do the unnecessary migration, I get this error:

Effectively, this blocks me from further changing the table and keeping the schemas in sync.

Sync schema changes across environments

Hi @michael_h, from looking at this:

It does look like an unnecessary change. We should be able to change the view from GUI to SQL and remove the ALTER TABLE statement. Alternatively, we should be able to unmark the checkbox for the id column shown on the same screenshot and try again.

Hey @Paulo

thanks for looking into it - I can confirm that your workaround of unticking the checkbox on this individual change in GUI mode would allow other changes to still be propagated.

Do you agree though, that this is a bug in Retool Database Schema Migration?

  1. The schemas are actually in sync, but it detects unnecessary changes. This makes it much harder for the user to confirm whether the schemas are in sync.
  2. The produced SQL is incorrect, which makes it cumbersome to apply other schemas that still need syncing.

Could you please put this in the Retool Bug Tracker?

Best
Michael

Hi @michael_h, I tried to reproduce this issue with no success. Could you share what updates where done on staging before the failed migration to production? This would help us identify what caused this issue.

Thank you in advance! :slightly_smiling_face:

Hi Paulo,

sorry for replying super late.

It was detecting fluke changes when the table contained an auto-incrementing int or an enum -- even if there was no real change.

This seems to be fixed now.
I can no longer reproduce the issue after upgrading to 3.52 (self hosted).

Best
Michael

No worries, @michael_h. I'm happy to heat the issues went away! :slightly_smiling_face: