Total Blog Views: 56
Blog Status: publish
Created By: swazahmad Created at: 07-14-2021
Tags: rails ruby ruby on rails shadbox migration rails migration rollback delete migration rails 07
$rails generate migration migration description
The easiest way to make a change in the database schema
in Rails is to generate the migration. NEVER do a change
directly on your database.
$ rails db:migrate:reset
This will drop the database information and run migration
on a fresh one
$rails db:seed
Loads the data from the file: db/seeds.rb into the database. It's a very useful way of populating a database with the initial data
needed for a Rails project.
$rails db:migrate
Run the migration of a model and it's attributes.
Down to the specific version or sepcific File
$ rails db:migrate:down VERSION=version_name #20210909
To rollback to previous lattest migration
$rails db:rollback
Rollback to number of steps for example 5 migration I want to revert
$rails db:rollback STEP=5
$rails db:migrate:status | grep 'user'
Thank you So much for reading
we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.
© Copyright Shadbox. All Rights Reserved
Rate Blog :
Share on :
Do you have any blog suggestion? please click on the link