・ Develop applications using Rails ・ Use AWS ・ Create a web server on EC2
If you ever wanted to reset the DB when developing in your own local environment
I was recreating the DB using riset.
After deploying this time, because I made various changes to the migration file etc.
I thought about resetting it once in the production environment and rebuilding it.
## Database reset in production environment
```ruby
RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rails db:drop
You can reset the DB in production with this command (Is it possible to reset the DB in the production environment?)
rails db:create RAILS_ENV=production
rails db:migrate RAILS_ENV=production
rails db:seed RAILS_ENV=production
In the above description, if you have any improvement plans or suggestions such as if there is such a risk, I would appreciate it if you could let me know in the comments.
We hope you find this helpful.
Recommended Posts