You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
531 B
TypeScript
15 lines
531 B
TypeScript
import { readMigrationFiles } from 'drizzle-orm/migrator';
|
|
import { writeFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const dbBase = join(__dirname, '../../src/database');
|
|
const migrationsFolder = join(dbBase, './migrations');
|
|
const migrations = readMigrationFiles({ migrationsFolder: migrationsFolder });
|
|
|
|
writeFileSync(
|
|
join(dbBase, './client/migrations.json'),
|
|
JSON.stringify(migrations, null, 2), // null, 2 adds indentation for better readability
|
|
);
|
|
|
|
console.log('🏁 client migrations.json compiled!');
|