Skip to content
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

Merged
merged 7 commits into from
Jul 31, 2023
Merged

Rollback migrations #4083

merged 7 commits into from
Jul 31, 2023

Conversation

aduffeck
Copy link
Contributor

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.

Copy link
Contributor

@kobergj kobergj left a 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...

@@ -30,7 +30,7 @@ import (
)

// Migration0001 creates the spaces directory structure
func (m *Migrator) Migration0001() (Result, error) {
func (m *Migrator) Up0001() (Result, error) {
Copy link
Contributor

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?

Comment on lines 121 to 122
migrateMethod := reflect.ValueOf(m).MethodByName(method)
v := migrateMethod.Call(nil)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kobergj I came up with 5076031 which avoids both reflect and hard coded lists. wdyt?

Copy link
Contributor

@kobergj kobergj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@aduffeck aduffeck merged commit db79e9b into cs3org:edge Jul 31, 2023
@aduffeck aduffeck deleted the rollback-migrations branch July 31, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants