Command trong rails thực sự rất là nhiều và củng không nhớ hết được syntax. Đâu đó thì củng chỉ nhớ được 1 vài task hay dùng, thay vì mỗi lần như vậy mình phải gõ cmd bin/rails -T để xem các command line có sẵn
Ruby
rails db:create # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_...
rails db:drop # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_EN...
rails db:encryption:init # Generate a set of keys for configuring Active Record encryption in a given environment
rails db:environment:set # Set the environment value for the database
rails db:fixtures:load # Loads fixtures into the current environment's database
rails db:migrate # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rails db:migrate:down # Runs the "down" for a given migration VERSION
rails db:migrate:redo # Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
rails db:migrate:status # Display status of migrations
rails db:migrate:up # Runs the "up" for a given migration VERSION
rails db:prepare # Runs setup if database does not exist, or runs migrations if it does
rails db:reset # Drops and recreates all databases from their schema for the current environment and ...
rails db:rollback # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rails db:schema:cache:clear # Clears a db/schema_cache.yml file
rails db:schema:cache:dump # Creates a db/schema_cache.yml file
rails db:schema:dump # Creates a database schema file (either db/schema.rb or db/structure.sql, depending on...
rails db:schema:load # Loads a database schema file (either db/schema.rb or db/structure.sql, depending on ...
rails db:seed # Loads the seed data from db/seeds.rb
rails db:seed:replant # Truncates tables of each database for current environment and loads the seeds
rails db:setup # Creates all databases, loads all schemas, and initializes with the seed data (use db...
rails db:version # Retrieves the current schema version number
rails test:db # Run tests quickly, but also reset dbThay vì phải nhớ hết như vậy thì ta nên thiết lập alias cho đơn giản.
Thiết lập alias tại: vi ~/.bashrc
Ruby
alias br='bin/rails'
alias be='bundle exec'
alias brdm='bin/rails db:migrate RAILS_ENV=development && bin/rails db:migrate RAILS_ENV=test'
alias brdrol='bin/rails db:rollback STEP=1 && bin/rails db:rollback STEP=1 RAILS_ENV=test'
alias bi='bundle install'
alias ees="export EDITOR='subl -w'"
alias bd="./bin/dev"
alias brdcm="br db:drop db:create db:migrate"
alias brdcms="br db:drop db:create db:migrate db:seed"
alias rcr="bin/rails cypress:run"
alias rco="bin/rails cypress:open"
alias resetdbtest='bin/rails db:drop db:create db:migrate RAILS_ENV=test'
alias resetdbdev='bin/rails db:drop db:create db:migrate RAILS_ENV=development'
alias brg='bin/rails generate'
alias brt='bin/rails test'
alias fd="foreman start -f Procfile.dev"Happy Coding!
7 comments
Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.com/en-NG/register?ref=YY80CKRN
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Your article helped me a lot, is there any more related content? Thanks! https://www.binance.com/register?ref=IXBIAFVY
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Sonn andd motuer hve sexWommen haed hhat fuckingAtlannta bbw escortDrunk gil givinng
blow jobb cauught onn spy camFreee hardccore ggay sexx moviesRedtubhe good asss poundingJossh roa homosexualStarsuip adcult bookk storeFunny sexual pictureTeeen cheerleader hairy cuntInnopcent gikrl talkked intto sexx videoAdulot pdff pawssword recovery
v2.2.0Celeeberities nudce picsFreee erotikc fetish storyJaap girl stripNudde vampire moviesWalkthropugh sesxy vacationYuri hentai artSexyy bolywood
muhsic videosFenale orgasm rom sex3d cattoon nudesDomkination kombat mortalHow tto touch a woman’s breastAbsooutley free intracial sexMature ahnt analPassword
foor sexMiika ttan bdsmIntrrracial amjateurs brotja loverSyrachuse
nyy sexx clubsHtttp redlips rru bikiniSexx oftfender mpegSeex carnnage woodman galleryFrree
gloryhole amattures picturesVerison wirelless sexAcetoe annd nakled leatherClass
softcoreHer exy thighs cann squeeze
Alsso vizit my website; bokepindo.win