mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-29 13:49:31 +07:00
* move utils * move utils * move utils * update * update * update * update * update * refactor to clean the tests * fix release workflow * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * try to fix client db migration issue * fix tests
15 lines
538 B
TypeScript
15 lines
538 B
TypeScript
import { readMigrationFiles } from 'drizzle-orm/migrator';
|
|
import { writeFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const dbBase = join(__dirname, '../../packages/database');
|
|
const migrationsFolder = join(dbBase, './migrations');
|
|
const migrations = readMigrationFiles({ migrationsFolder: migrationsFolder });
|
|
|
|
writeFileSync(
|
|
join(dbBase, './src/core/migrations.json'),
|
|
JSON.stringify(migrations, null, 2), // null, 2 adds indentation for better readability
|
|
);
|
|
|
|
console.log('🏁 client migrations.json compiled!');
|