Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

41
rails-db Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# rails db
> Various database-related subcommands for Ruby on Rails.
> More information: <https://guides.rubyonrails.org/command_line.html>.
- 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`