sincecutoff.com
← all changes

netlify database command provisions and manages Netlify Database

Introduced 2026-04-28 · score 0.98

HOW TO USE IT

When a linked project needs Netlify Database setup, run `netlify database init` for interactive setup or `--yes` to accept defaults; use the database subcommands to inspect and manage the local database and migrations.

netlify database init --yes
netlify database status --branch <branch>
netlify database migrations apply

WHY THIS HELPS

Provision or manage a Netlify Database for a repository's application using the Netlify CLI.

REQUIREMENTS AND LIMITATIONS

  • Version: v26.0.0
  • --yes: For `database init`, skip prompts and accept defaults.
  • --branch <branch>: For `database status`, query a named Netlify branch; defaults to the local development database.
  • --show-credentials: For `database status`, include the full connection string, including username and password.
  • --json: For `database status`, output the result as JSON.
  • --to <name>: For `database migrations apply`, apply migrations up to a migration name or prefix; if omitted, apply all pending migrations.
  • --branch <branch>: For `database migrations pull`, pull migrations for the named branch; defaults to `production`. With `--branch` and no value, use the local Git branch.
  • --force: For `database migrations pull`, skip the confirmation prompt before overwriting local migration files.
  • --description <description>: For `database migrations new`, set the migration purpose used to generate the file name; omitted value prompts interactively.
  • --scheme <scheme>: For `database migrations new`, choose the migration prefix scheme: `sequential` or `timestamp`. The docs do not say these are mutually exclusive with other options.
  • filter: For monorepos, specify the application in which to run the root command.
  • debug: Print debugging information for the root command.
  • auth: Netlify auth token; can run the root command without logging in.
  • Prerequisite: Node.js 20.12.2 or later and Netlify CLI 26.0.0 or later.
  • Prerequisite: Install the Netlify CLI; the docs show `npm install -g netlify-cli`.
  • `database init` is interactive setup that installs the package, scaffolds a starter migration, and verifies the database.
  • `database reset` resets the local development database, removing all data and tables.
  • The `branch` flag selects a Netlify branch and defaults to the local development database.
  • `auth` can be used to run the command without logging in.
  • Docs conflict: The release note describes bare `netlify database` as provisioning a production-ready database. The current CLI reference describes `netlify database init` as project setup and says the listed commands interact with the local database; it does not document bare `netlify database` as provisioning a database.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card