snippetbashTip
rails db — Various database-related subcommands for Ruby on Rails. More information: <https://guides.rubyonrail
Viewed 0 times
relatedcommandvariousdatabaseclirails dbforsubcommands
Problem
How to use the
rails db command: Various database-related subcommands for Ruby on Rails. More information: <https://guides.rubyonrails.org/active_record_migrations.html>.Solution
rails db — Various database-related subcommands for Ruby on Rails. More information: <https://guides.rubyonrails.org/active_record_migrations.html>.Create databases, load the schema, and initialize with seed data:
rails db:setupAccess the database console:
rails dbCreate the databases defined in the current environment:
rails db:createDestroy the databases defined in the current environment:
rails db:dropRun pending migrations:
rails db:migrateView the status of each migration file:
rails db:migrate:statusRollback the last migration:
rails db:rollbackFill the current database with data defined in
db/seeds.rb:rails db:seedCode Snippets
Create databases, load the schema, and initialize with seed data
rails db:setupAccess the database console
rails dbCreate the databases defined in the current environment
rails db:createDestroy the databases defined in the current environment
rails db:dropRun pending migrations
rails db:migrateContext
tldr-pages: common/rails db
Revisions (0)
No revisions yet.