{
  "id": 12920786,
  "title": "Stop Cursor from running drizzle-kit push --force on a real database",
  "url": "https://urgent.news/2026/10/08/stop-cursor-from-running-drizzle-kit-push-force-on-a-real-database",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-08T18:02:52.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/labyrinthlab/stop-cursor-from-running-drizzle-kit-push-force-on-a-real-database-2mg7"
  },
  "original_language": "en",
  "account": "Drizzle-kit's push command applies schema changes directly to the database, without creating migration files. When changing a schema, push runs a safety check that flags statements which could lose data, such as dropping a table or column, changing a column's type, or adding a NOT NULL column without a default value. If any statements are flagged, push prompts the user to confirm they still want to push the changes, providing a safety net against accidental data loss. However, when running the push command in non-interactive environments, such as continuous integration pipelines, the prompt library refuses to run and throws an error. To address this, there are several guardrails that can be implemented. First, a rule can be created to stop the agent from running any drizzle-kit command that could potentially cause data loss, including \"drizzle-kit push --force\", without asking the user. Additionally, if push stops on a prompt or a TTY error, the agent should not add the \"--force\" flag and should instead quote the prompt to the user, offering three options: using \"drizzle-kit generate\" to see the new SQL file, waiting for approval before running \"drizzle-kit migrate\", or using \"drizzle-kit generate --explain\" to view the planned SQL without applying it. This approach ensures that destructive statements are visible in review and allows the user to make an informed decision before proceeding.",
  "summary": "Here is the failure mode. You change a Drizzle schema and ask the Cursor agent to sync the database. It runs npx drizzle-kit push . The command stops on a prompt, or errors because there is no terminal to prompt in. The agent retries with npx drizzle-kit push --force . It finishes. A table you cared about is now empty, or a renamed column lost its data. This post covers what push and --force…",
  "key_points": [
    "Push command flags statements causing data loss",
    "Non-interactive environments prevent safety prompt",
    "Guardrails stop destructive drizzle-kit commands"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}