Skip to content

Add safeguards to avoid accidental db push or functions deploy to production #4637

@Jonny1987

Description

@Jonny1987

Is your feature request related to a problem? Please describe.
I have an project each for development and for production. Although unlikely, it is possible for me to run supabase link and accidentally select the production project.

If this does happen, it's not likely to be noticed until the push has completed because:

  1. The output of supabase link does not specify which project was just linked
  2. supabase db push and supabase deploy do not ask for confirmation that you want to deploy to the linked project and only show the linked project after the deploy or push has completed

(Maybe the correct thing is to use branching but I set this up before branching was available and haven't migrated. I'm not sure if this is a problem with branching)

Describe the solution you'd like
The cli should state which project was just linked to and confirm (requiring the user to respond before the command continues) which project will be pushed/deployed to when running supabase db push or supabase functions deploy.

An alternative feature would be an option in config.toml to include/exclude projects that the cli can use. This way I can exclude my production environment and then I won't even be able to link to it (since 99% of the time schema changes and edge function deployments happen in my CI)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions