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

feat(cli): migrations for team validation #1124

Open
wants to merge 1 commit into
base: refactor/team-validation-in-api-and-db
Choose a base branch
from

Conversation

AleksandrMatsko
Copy link
Member

PR Summary

In #1123 db schema is changed a bit. This PR provides necessary migrations

updating from 2.13

Use following command to update to new version.

cli --update --from-version '2.13'

This command will do the following:

  1. Get all teams from DB.
  2. Group teams with same names.
  3. For teams with same names change name (example: ["name", "name", "name"] -> ["name", "name1", "name2"]).
  4. Update teams with name changed.
  5. Save pairs teamName:team.ID to "moira-teams-by-names" redis hash.

downgrading to 2.13

Use following command to downgrade to previous version.

cli --downgrade --to-version '2.13'

This command will delete "moira-teams-by-names" redis hash.

@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review November 13, 2024 11:16
@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner November 13, 2024 11:16
@AleksandrMatsko AleksandrMatsko changed the title feat: migrations for team validation feat(cli): migrations for team validation Nov 13, 2024
}
}

logger.Info().
Copy link
Member

Choose a reason for hiding this comment

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

давай еще залогаем само имя?

Copy link
Member Author

Choose a reason for hiding this comment

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

Не совсем понял :(.
Тут на выходе мапа получается со всеми командами, где ключ - название, значение - слайс из команд с таким именем.

Или предлагаешь здесь статистику вывести, что с таким-то именем столько-то команд?

Copy link
Member

Choose a reason for hiding this comment

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

чтоб в логе было видно кого переиначили - да

Copy link
Member

Choose a reason for hiding this comment

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

а на проде у нас много, кстати таких, кого придется переименовывать?

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