When prototyping or iterating on a Data Connect GraphQL schema, updating fields that involve underlying constraints (e.g., unique indices or foreign key constraints) can cause firebase dataconnect:sql:migrate to fail with unrecoverable SQL DDL errors (e.g., undroppable indices).
Once this happens, the CLI migration command halts completely and provides no automated recourse to reset or force-apply the schema.
To resolve this currently, a developer must manually log into the GCP Console and use Cloud SQL Studio to run DROP TABLE ... CASCADE;. However, accessing Cloud SQL Studio requires an active Cloud Billing account. For developers prototyping on free-tier or trial setups, this forces an unnecessary loop of upgrading to a paid plan just to drop tables in a dev database, then downgrading again.
You could introduce a CLI flag like firebase dataconnect:sql:migrate --force-reset or firebase dataconnect:sql:reset that executes a full schema tear-down/re-initialization (DROP SCHEMA public CASCADE; CREATE SCHEMA public;) directly from the CLI during development sessions.
When prototyping or iterating on a Data Connect GraphQL schema, updating fields that involve underlying constraints (e.g., unique indices or foreign key constraints) can cause firebase dataconnect:sql:migrate to fail with unrecoverable SQL DDL errors (e.g., undroppable indices).
Once this happens, the CLI migration command halts completely and provides no automated recourse to reset or force-apply the schema.
To resolve this currently, a developer must manually log into the GCP Console and use Cloud SQL Studio to run DROP TABLE ... CASCADE;. However, accessing Cloud SQL Studio requires an active Cloud Billing account. For developers prototyping on free-tier or trial setups, this forces an unnecessary loop of upgrading to a paid plan just to drop tables in a dev database, then downgrading again.
You could introduce a CLI flag like firebase dataconnect:sql:migrate --force-reset or firebase dataconnect:sql:reset that executes a full schema tear-down/re-initialization (DROP SCHEMA public CASCADE; CREATE SCHEMA public;) directly from the CLI during development sessions.