Using maintenance mode on the backend here for simplicity. Other processes may be used to avoid maintenance mode, but that doesn’t affect PowerSync system.

  1. Deploy Sync Rules containing both the old and the new table name, with a mapping (alias) from the new name to the old one (so that both end up with the old name on the client). This will cause validation errors because of a missing table, but PowerSync will still allow the deploy.
  2. Wait for Sync Rule reprocessing to complete.
  3. Put the backend in maintenance mode.
    1. i.e. Backend needs to be made unavailable to avoid breaking things during migrations.
  4. Apply the source schema changes (i.e. in Postgres database)
  5. Deploy backend changes and re-activate backend.
  6. Remove the old table from Sync Rules, then deploy and activate the Sync Rules.