Changeset 0.10.4 (#60)

This commit is contained in:
2026-02-24 22:01:20 +00:00
parent ba2cd42428
commit e5ee78c498
18 changed files with 152 additions and 31 deletions

View File

@@ -0,0 +1,14 @@
-- Migration 005: Add model_type to model_catalog
--
-- Providers like Venice return a "type" field per model (e.g. "text", "embedding", "image").
-- This column captures that classification so role dropdowns can filter appropriately:
-- - "embedding" role → only embedding models
-- - "utility" role → only chat/text models
--
-- Default is "chat" (the overwhelming majority of models). Provider sync will
-- populate from the wire response when available — NO hardcoding of model types.
ALTER TABLE model_catalog ADD COLUMN IF NOT EXISTS model_type VARCHAR(20) DEFAULT 'chat';
-- Index for role UI filtering (e.g. "show me all embedding models for this provider")
CREATE INDEX IF NOT EXISTS idx_model_catalog_type ON model_catalog(model_type);

View File

@@ -196,6 +196,19 @@ func TruncateAll(t *testing.T) {
}'::jsonb)
ON CONFLICT (key) DO NOTHING
`)
// Re-seed platform_policies — also wiped by CASCADE from users truncation
// (platform_policies.updated_by REFERENCES users(id)).
DB.Exec(`
INSERT INTO platform_policies (key, value) VALUES
('allow_user_byok', 'false'),
('allow_user_personas', 'false'),
('allow_raw_model_access', 'true'),
('allow_registration', 'true'),
('default_user_active', 'false'),
('allow_team_providers', 'true')
ON CONFLICT (key) DO NOTHING
`)
}
// SeedTestUser creates a test user and returns the user ID.