Team/User: UID migrations (#82298)

* Add user uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Add team uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Run team uid migration
This commit is contained in:
Karl Persson
2024-02-12 14:48:29 +01:00
committed by GitHub
parent 685e84b1f8
commit 1315c67c8b
12 changed files with 84 additions and 16 deletions
@@ -508,7 +508,8 @@ func checkSeededPermissions(t *testing.T, permissions []resourcePermissionDTO) {
func seedPermissions(t *testing.T, resourceID string, sql *sqlstore.SQLStore, service *Service) {
t.Helper()
// seed team 1 with "Edit" permission on dashboard 1
teamSvc := teamimpl.ProvideService(sql, sql.Cfg)
teamSvc, err := teamimpl.ProvideService(sql, sql.Cfg)
require.NoError(t, err)
team, err := teamSvc.CreateTeam("test", "test@test.com", 1)
require.NoError(t, err)
_, err = service.SetTeamPermission(context.Background(), team.OrgID, team.ID, resourceID, "Edit")