Generators

$ buffalo db g --help

Usage:
  buffalo db generate [command]

Aliases:
  generate, g


Available Commands:
  config      Generates a database.yml file for your project.
  fizz        Generates Up/Down migrations for your database using fizz.
  model       Generates a model for your database
  sql         Generates Up/Down migrations for your database using SQL.

Global Flags:
  -c, --config string   The configuration file you would like to use.
  -d, --debug           Use debug/verbose mode
  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default "development")
  -p, --path string     Path to the migrations folder (default "./migrations")

Use "buffalo db generate [command] --help" for more information about a command.

Models

$ buffalo db g model --help

Generates a model for your database

Usage:
  buffalo db generate model [name] [flags]

Aliases:
  model, m


Flags:
  -s, --skip-migration   Skip creating a new fizz migration for this model.

Global Flags:
  -c, --config string   The configuration file you would like to use.
  -d, --debug           Use debug/verbose mode
  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default "development")
  -p, --path string     Path to the migrations folder (default "./migrations")

You can remove generated model by running:

$ buffalo db destroy model [name]

Or in short form:

$ buffalo d m [name]

Migrations

For information on generating migrations see /docs/db/migrations.