Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

2.2 KB
Raw Blame
## Remote sync now tracks a published table through its TableUserSettings, FieldUserSettings, and Dimensions
## rather than its Table and Fields. A Table or Field row whose table or field has a user settings row, and no row of
## that user settings yet, becomes that user settings row, keeping its pending status so unpushed changes are still
## pushed; the rest are deleted after. The first changeset was merged as v65.2026-10-16T00:00:00, an id it shared with
## 20261016_dependency_status_unresolved_tables.yaml, which deletes that id; it is idempotent, so it runs again harmlessly.

databaseChangeLog:
  - changeSet:
      id: v65.2026-10-20T00:00:02
      author: ranquild
      comment: Turn the RemoteSyncObject rows of Tables with user settings into TableUserSettings rows
      changes:
        - sql:
            sql: >-
              UPDATE remote_sync_object SET model_type = 'TableUserSettings'
              WHERE model_type = 'Table'
              AND EXISTS (SELECT 1 FROM metabase_table_user_settings tus WHERE tus.table_id = remote_sync_object.model_id)
              AND NOT EXISTS (SELECT 1 FROM (SELECT model_id FROM remote_sync_object WHERE model_type = 'TableUserSettings') rso
                              WHERE rso.model_id = remote_sync_object.model_id)
      rollback: []

  - changeSet:
      id: v65.2026-10-16T00:00:01
      author: ranquild
      comment: Turn the RemoteSyncObject rows of Fields with user settings into FieldUserSettings rows
      changes:
        - sql:
            sql: >-
              UPDATE remote_sync_object SET model_type = 'FieldUserSettings'
              WHERE model_type = 'Field'
              AND EXISTS (SELECT 1 FROM metabase_field_user_settings fus WHERE fus.field_id = remote_sync_object.model_id)
              AND NOT EXISTS (SELECT 1 FROM (SELECT model_id FROM remote_sync_object WHERE model_type = 'FieldUserSettings') rso
                              WHERE rso.model_id = remote_sync_object.model_id)
      rollback: []

  - changeSet:
      id: v65.2026-10-16T00:00:02
      author: ranquild
      comment: Delete the remaining RemoteSyncObject rows of Tables and Fields
      changes:
        - sql:
            sql: DELETE FROM remote_sync_object WHERE model_type IN ('Table', 'Field')
      rollback: []