Add the free Fast migration

This commit is contained in:
Ritel-T
2026-09-01 04:34:23 +09:00
parent c7cf84ad39
commit eebf4e3ffb
3 changed files with 24 additions and 0 deletions
@@ -0,0 +1,5 @@
ALTER TABLE groups
ADD COLUMN IF NOT EXISTS free_openai_fast BOOLEAN NOT NULL DEFAULT FALSE;
COMMENT ON COLUMN groups.free_openai_fast IS
'Whether Fast/priority requests in this OpenAI/Composite group are billed to users at Standard price';
@@ -0,0 +1,18 @@
package migrations
import (
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestGroupFreeOpenAIFastMigration(t *testing.T) {
content, err := FS.ReadFile("233_group_free_openai_fast.sql")
require.NoError(t, err)
sql := strings.Join(strings.Fields(string(content)), " ")
require.Contains(t, sql,
"ADD COLUMN IF NOT EXISTS free_openai_fast BOOLEAN NOT NULL DEFAULT FALSE")
require.Contains(t, sql, "COMMENT ON COLUMN groups.free_openai_fast")
}