Skip to content

dataconnect: Need a --force-reset / --drop-tables flag for blocked schema migrations in development #10907

Description

@vzsolt1981

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions