Rails Quick Tips - Rolling Back Database Migrations

Опубликовано: 06 Октябрь 2024
на канале: webcrunch
1,234
27

Migrating database changes is relatively straightforward using Ruby on Rails. You may have gotten ahead in the local development environment and need to modify something added long ago. Depending on whether your app is long-standing or brand new, you have a few options.

Timestamps:
00:00 - Intro
00:50 - rails db:migrate:status
03:30 - rails db:rollback
04:00 - rails db:migrate:down VERSION
05:45 - rails db:rollback STEP
06:25 - My preferred approach to migration rollbacks

======

Hi, My name is Andy Leverenz and I work as a product designer and developer. For fun, I design, code, and write. Check out my blog called Web-Crunch https://web-crunch.com where I publish design and development tutorials with the occasional vlog.


📰 Subscribe to my newsletter
https://digest.web-crunch.com

♥️ Sponsor me on GitHub
https://github.com/sponsors/justalever

☕️ Keep me awake. Buy me a coffee
https://www.buymeacoffee.com/webcrunch

📰 One-Click Subscribe:
https://www.youtube.com/user/webcrunc...

💻 Previously published at:
https://web-crunch.com/posts/rails-qu...

💎Ruby on Rails Course: HELLO RAILS
https://hellorails.io

💻 Check out the blog:
https://web-crunch.com

🦄 Check out my personal site:
https://justalever.com

🚀 Links:
Weekly Newsletter: https://digest.web-crunch.com/
Twitter:   / webcrunchblog  
Github: https://github.com/justalever

📘Check out my book on UX Design:
"LUXD: Learn User Experience Design"
https://web-crunch.com/products/luxd

📙 Check out my FREE book on Tumblr Theming:
"Pro Tumblr Theming"
https://web-crunch.com/products/ptt