mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-28 16:09:34 +00:00
Add the free Fast migration
This commit is contained in:
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user