Rails migrations in non-Rails (and non Ruby) projects.
- Git
- Ruby 3.1.2 (using RVM to install ruby)
- Postgresql/Mysql
- Clone this repository and install the prerequisites above
- Run
bundleto install dependencies (tryxcode-select --installif bundle got error) - Copy
.envfromenv.sampleand modify the configuration value appropriately - Setup database
rake db:create && rake db:migrate
rake db:new_migration name=foo_bar_migration
rake db:migrate
rake db:rollback
See https://github.com/thuss/standalone-migrations https://guides.rubyonrails.org/active_record_migrations.html
for more detail information