Skip to content

Commit e8d134a

Browse files
committed
fix: update SaveModelProvider to use model_providers table
1 parent 00c338c commit e8d134a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

database/db.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ func InitDB() error {
6666
return err
6767
}
6868

69-
// Auto-migrate for existing tables
70-
// Ignore errors if columns already exist
71-
DB.Exec("ALTER TABLE projects ADD COLUMN workflow TEXT DEFAULT ''")
72-
DB.Exec("ALTER TABLE projects ADD COLUMN cover_image TEXT DEFAULT ''")
73-
7469
log.Println("Database initialized successfully")
7570
return nil
7671
}

database/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func SaveModelProvider(config ModelProvider) error {
4646

4747
// Update
4848
_, err := DB.NamedExec(`
49-
UPDATE projects
49+
UPDATE model_providers
5050
SET name = :name, type = :type, api_key = :api_key, base_url = :base_url, updated_at = CURRENT_TIMESTAMP
5151
WHERE id = :id
5252
`, config)

0 commit comments

Comments
 (0)