mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-24 20:35:26 +02:00
rails-db: add page (#3070)
This commit is contained in:
parent
241e284db5
commit
f44b2ad3fa
1 changed files with 35 additions and 0 deletions
35
pages/common/rails-db.md
Normal file
35
pages/common/rails-db.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# 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`
|
Loading…
Add table
Reference in a new issue