-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for a custom migration table name #207
Conversation
Implementation is done then :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice work thanks! <3 Only some minor situations left
- The iter call isn't needed indeed, and can be replaced by adding an & - Added const DEFAULT_MIGRATION_TABLE_NAME - Removed TODO from tiberius driver
…efinery into custom_migration_table_name
Awesome, thanks! |
Might be best to wait a little with releasing. I'd also like to implement the custom schema for the schema table ( see my comment in #205), that could go in the same minor release Edit: err, disregard. Seems I completely misunderstood the meaning of schema 😅 |
This PR adds support for a custom name for the migration table (by default
refinery_schema_history
).Motivation
I've seen quite some issues requesting this is one way or another:
Approach
The PR adds a new field to the
Runner
struct,migration_table_name
and an associated functionset_migration_table_name
. The value ofmigration_table_name
is passed around to the places it needs to be as a&str
. Inrefinery_core::traits
, there are 3const &str
's, which now include a 'variable'%MIGRATION_TABLE_NAME%
which must be replaced before being used, this is done everywhere correctly.Backwards compatibility
This PR does not break backwards compatibility, mostly. For most binaries, this PR does not break backwards compatibility. However, the traits
Migrate
andAsyncMigrate
have had changes to their functions, the only change to each function is the addition of a new parameter,migration_table_name
. I doubt anyone uses these traits outside of therefinery
crate, but it is a breaking change.Modification to tests
The tests have been modified to conform with the updated function signatures, i.e. the
migration_table_name
parameterThanks.