tldr/pages/common/rails-db.md
Lucas Gabriel Schneider a5fe31bc47
multiple pages: format technical tokens (#5119)
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2021-01-31 12:05:18 -05:00

610 B

rails db

Various database-related subcommands for Ruby on Rails.

  • Create databases, load the schema, and initialize with seed data:

rails db:setup

  • Access the database console:

rails db

  • Create the databases defined in the current environment:

rails db:create

  • Destroy the databases defined in the current environment:

rails db:drop

  • Run pending migrations:

rails db:migrate

  • View the status of each migration file:

rails db:migrate:status

  • Rollback the last migration:

rails db:rollback

  • Fill the current database with data defined in db/seeds.rb:

rails db:seed