創意題與資料庫整合
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { testConnection } from './connection'
|
||||
import { createUsersTable } from './models/user'
|
||||
import { createLogicQuestionsTable } from './models/logic_question'
|
||||
import { createCreativeQuestionsTable } from './models/creative_question'
|
||||
|
||||
// 初始化資料庫
|
||||
export async function initializeDatabase(): Promise<boolean> {
|
||||
@@ -16,10 +17,13 @@ export async function initializeDatabase(): Promise<boolean> {
|
||||
|
||||
// 建立用戶表
|
||||
await createUsersTable()
|
||||
|
||||
|
||||
// 建立邏輯思維題目表
|
||||
await createLogicQuestionsTable()
|
||||
|
||||
|
||||
// 建立創意能力測試題目表
|
||||
await createCreativeQuestionsTable()
|
||||
|
||||
console.log('✅ 資料庫初始化完成')
|
||||
return true
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user