=test_update_homework_tests_and_work_log
Some checks failed
CI / build-deploy (push) Has been cancelled
Some checks failed
CI / build-deploy (push) Has been cancelled
This commit is contained in:
@@ -597,6 +597,23 @@ export const homeworkAnswers = mysqlTable("homework_answers", {
|
||||
}),
|
||||
}));
|
||||
|
||||
export const aiProviders = mysqlTable("ai_providers", {
|
||||
id: id("id").primaryKey(),
|
||||
provider: mysqlEnum("provider", ["zhipu", "openai", "gemini", "custom"]).notNull(),
|
||||
baseUrl: varchar("base_url", { length: 512 }),
|
||||
model: varchar("model", { length: 128 }).notNull(),
|
||||
apiKeyEncrypted: text("api_key_encrypted").notNull(),
|
||||
apiKeyLast4: varchar("api_key_last4", { length: 4 }),
|
||||
isDefault: boolean("is_default").default(false).notNull(),
|
||||
createdBy: varchar("created_by", { length: 128 }),
|
||||
updatedBy: varchar("updated_by", { length: 128 }),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(),
|
||||
}, (table) => ({
|
||||
providerIdx: index("ai_provider_idx").on(table.provider),
|
||||
defaultIdx: index("ai_provider_default_idx").on(table.isDefault),
|
||||
}));
|
||||
|
||||
// Re-export old courses table if needed or deprecate it.
|
||||
// Assuming we are replacing the old simple schema with this robust one.
|
||||
// But if there were existing tables, we might keep them or comment them out.
|
||||
|
||||
Reference in New Issue
Block a user