-
Notifications
You must be signed in to change notification settings - Fork 112
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
Rollback migrations #4083
Rollback migrations #4083
Conversation
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.
High level nitpicking as always...
pkg/storage/utils/decomposedfs/migrator/0004_switch_to_messagepack_space_index.go
Outdated
Show resolved
Hide resolved
pkg/storage/utils/decomposedfs/migrator/0004_switch_to_messagepack_space_index.go
Outdated
Show resolved
Hide resolved
pkg/storage/utils/decomposedfs/migrator/0004_switch_to_messagepack_space_index.go
Outdated
Show resolved
Hide resolved
pkg/storage/utils/decomposedfs/migrator/0004_switch_to_messagepack_space_index.go
Outdated
Show resolved
Hide resolved
@@ -30,7 +30,7 @@ import ( | |||
) | |||
|
|||
// Migration0001 creates the spaces directory structure | |||
func (m *Migrator) Migration0001() (Result, error) { | |||
func (m *Migrator) Up0001() (Result, error) { |
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.
I like the old naming more. Can we go for MigrationXXXX
and RollbackXXXX
?
migrateMethod := reflect.ValueOf(m).MethodByName(method) | ||
v := migrateMethod.Call(nil) |
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.
Can we avoid the reflect magic? I'd be more fine with a hardcoded list.
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.
pkg/storage/utils/decomposedfs/migrator/0005_fix_messagepack_space_index_format.go
Outdated
Show resolved
Hide resolved
Co-authored-by: kobergj <[email protected]>
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.
Nice 👍
The decomposedfs now supports rolling back migrations (starting with 0004). It also got a Migrations() method which returns the list of migrations incl. their states.