rom-rb / rom-sql

SQL support for rom-rb
https://rom-rb.org
MIT License
217 stars 93 forks source link

Simplify setting up migrator #310

Open solnic opened 5 years ago

solnic commented 5 years ago

Currently gateway options does not support passing migrator options, so if you need to customize it, you need to manually instantiate a connection, then migrator, then pass it as an option to rom configuration, which is silly.

This is what we could have instead:

config = ROM::Configuration.new(:sql, "postgresql://localhost/rom", migrator: { path: "my_migrations_path" })

This is a matter of tweaking logic in migration extension because right now it only supports migrator object in options.

cllns commented 2 years ago

Looks like this can be closed, it was addressed in #311, though there was a comment that it should allow nil as an option stilll, which may have broken with that PR https://github.com/rom-rb/rom-sql/pull/311#issuecomment-440705623