From 569768e657fc8913579f0b7a1ef735d15f0f5a66 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sun, 11 Oct 2026 16:35:33 +0200 Subject: [PATCH] test(updates): account for the oauth-identities migration in history and rollback counts --- updates/organisations_test.go | 5 +++-- updates/user_groups_test.go | 4 ++-- updates/user_session_test.go | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/updates/organisations_test.go b/updates/organisations_test.go index 363b89c..128b0f7 100644 --- a/updates/organisations_test.go +++ b/updates/organisations_test.go @@ -49,6 +49,7 @@ func TestCreateOrganisationsMigration(t *testing.T) { "202610040001_create_user_api_tokens", "202610040002_add_users_last_seen", "202610040003_create_frontend_permissions", + "202610050001_create_oauth_identities", } if len(ids) != len(want) { t.Fatalf("history = %v", ids) @@ -59,9 +60,9 @@ func TestCreateOrganisationsMigration(t *testing.T) { } } - // The three admin migrations, API tokens, user groups, jwt blacklist, + // OAuth identities, the three admin migrations, API tokens, user groups, jwt blacklist, // throttle, extend-users, then organisations. - for range 9 { + for range 10 { if err := m.RollbackLast(); err != nil { t.Fatal(err) } diff --git a/updates/user_groups_test.go b/updates/user_groups_test.go index 18bb90e..3082abd 100644 --- a/updates/user_groups_test.go +++ b/updates/user_groups_test.go @@ -54,8 +54,8 @@ func TestUserGroupsMigration(t *testing.T) { t.Fatalf("users_groups primary key = %q", pk) } - // Frontend permissions, last seen, API tokens, user permissions, then user groups. - for range 5 { + // OAuth identities, frontend permissions, last seen, API tokens, user permissions, then user groups. + for range 6 { if err := m.RollbackLast(); err != nil { t.Fatal(err) } diff --git a/updates/user_session_test.go b/updates/user_session_test.go index cc337b1..788b827 100644 --- a/updates/user_session_test.go +++ b/updates/user_session_test.go @@ -47,9 +47,9 @@ func TestExtendUsersMigration(t *testing.T) { if !row.HasSelfSetPassword || row.IsActivated || row.MarketingConsent || row.IsOnboarded { t.Fatalf("defaults = %+v", row) } - // The three admin migrations, API tokens, user groups, jwt blacklist, + // OAuth identities, the three admin migrations, API tokens, user groups, jwt blacklist, // throttle, then extend-users. - for range 8 { + for range 9 { if err := m.RollbackLast(); err != nil { t.Fatal(err) } @@ -88,8 +88,8 @@ func TestCreateUserThrottleMigration(t *testing.T) { t.Fatalf("missing column %s", col) } } - // The three admin migrations, API tokens, user groups, jwt blacklist, then throttle. - for range 7 { + // OAuth identities, the three admin migrations, API tokens, user groups, jwt blacklist, then throttle. + for range 8 { if err := m.RollbackLast(); err != nil { t.Fatal(err) } @@ -120,8 +120,8 @@ func TestCreateJwtBlacklistMigration(t *testing.T) { t.Fatalf("missing column %s", col) } } - // The three admin migrations, API tokens, user groups, then jwt blacklist. - for range 6 { + // OAuth identities, the three admin migrations, API tokens, user groups, then jwt blacklist. + for range 7 { if err := m.RollbackLast(); err != nil { t.Fatal(err) }