update
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// packages/backend/src/migrations.ts
|
||||
import { Database } from 'sqlite3';
|
||||
// import { getDb } from './database'; // 可能不再需要直接从这里获取 db
|
||||
|
||||
/**
|
||||
* 运行数据库迁移。
|
||||
* 注意:此函数目前为空,仅作为未来迁移的占位符。
|
||||
* 数据库的初始模式创建在 database.ts 的初始化逻辑中处理。
|
||||
* @param db 数据库实例
|
||||
*/
|
||||
export const runMigrations = (db: Database): Promise<void> => {
|
||||
return new Promise<void>((resolve) => {
|
||||
console.log('[Migrations] 检查数据库迁移(当前无操作)。');
|
||||
// 在这里添加未来的迁移逻辑,例如:
|
||||
// db.serialize(() => {
|
||||
// db.run("ALTER TABLE users ADD COLUMN last_login INTEGER;", (err) => { ... });
|
||||
// // 更多迁移步骤...
|
||||
// });
|
||||
resolve(); // 立即解决,因为没有迁移要运行
|
||||
});
|
||||
};
|
||||
|
||||
// 可以保留一个默认导出或根据需要移除
|
||||
// export default runMigrations;
|
||||
Reference in New Issue
Block a user