diff --git a/dev/ci/go-backcompat/flakefiles/v3.38.0.json b/dev/ci/go-backcompat/flakefiles/v3.38.0.json index 1fc9ec95737b5..f0c0bafba99af 100644 --- a/dev/ci/go-backcompat/flakefiles/v3.38.0.json +++ b/dev/ci/go-backcompat/flakefiles/v3.38.0.json @@ -8,5 +8,10 @@ "path": "enterprise/internal/codemonitors", "prefix": "TestCodeMonitorHook", "reason": "Feature is experimental and not enabled for any customers" + }, + { + "path": "internal/database", + "prefix": "TestUsers_CheckAndDecrementInviteQuota", + "reason": "Test is written in a bad way (depends on default value definition, but does not affect backwards compatibility) in https://github.com/sourcegraph/sourcegraph/pull/33786." } ] diff --git a/internal/database/schema.md b/internal/database/schema.md index b3db1f45917fe..0898a6cc510cc 100755 --- a/internal/database/schema.md +++ b/internal/database/schema.md @@ -2429,7 +2429,7 @@ Foreign-key constraints: created_at | timestamp with time zone | | not null | now() updated_at | timestamp with time zone | | not null | now() deleted_at | timestamp with time zone | | | - invite_quota | integer | | not null | 15 + invite_quota | integer | | not null | 100 passwd | text | | | passwd_reset_code | text | | | passwd_reset_time | timestamp with time zone | | | diff --git a/internal/database/users_test.go b/internal/database/users_test.go index 0a332ff1b44dc..545d366474bd6 100644 --- a/internal/database/users_test.go +++ b/internal/database/users_test.go @@ -203,7 +203,7 @@ func TestUsers_CheckAndDecrementInviteQuota(t *testing.T) { } // Check that it's within some reasonable bounds. The upper bound number here can increased // if we increase the default. - if lo, hi := 0, 15; inviteQuota <= lo || inviteQuota > hi { + if lo, hi := 0, 100; inviteQuota <= lo || inviteQuota > hi { t.Fatalf("got default user invite quota %d, want in [%d,%d)", inviteQuota, lo, hi) } diff --git a/migrations/frontend/1649759318/down.sql b/migrations/frontend/1649759318/down.sql new file mode 100644 index 0000000000000..272804ec0d519 --- /dev/null +++ b/migrations/frontend/1649759318/down.sql @@ -0,0 +1,2 @@ +-- Undo the changes made in the up migration +ALTER TABLE IF EXISTS users ALTER COLUMN invite_quota SET DEFAULT 15; diff --git a/migrations/frontend/1649759318/metadata.yaml b/migrations/frontend/1649759318/metadata.yaml new file mode 100644 index 0000000000000..78dcfe3d3314d --- /dev/null +++ b/migrations/frontend/1649759318/metadata.yaml @@ -0,0 +1,2 @@ +name: change_default_invite_quota +parents: [1649269601] diff --git a/migrations/frontend/1649759318/up.sql b/migrations/frontend/1649759318/up.sql new file mode 100644 index 0000000000000..4a120da3950a6 --- /dev/null +++ b/migrations/frontend/1649759318/up.sql @@ -0,0 +1 @@ +ALTER TABLE IF EXISTS users ALTER COLUMN invite_quota SET DEFAULT 100;