backend v4 half
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import { execSync } from 'child_process';
|
||||
const migration_generate_name = process.argv[2];
|
||||
|
||||
if (!migration_generate_name) {
|
||||
console.error('Please provide a migration name: npm run migration:full <migration_name>');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(`Creating migration: ${migration_generate_name}`);
|
||||
execSync(`npx ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli migration:create ./src/Database/migrationsettings/${migration_generate_name}`, { stdio: 'inherit' });
|
||||
|
||||
console.log(`Generating migration: ${migration_generate_name}`);
|
||||
execSync(`npx ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli -d ormconfig.ts migration:generate ./src/Database/migrations/${migration_generate_name}`, { stdio: 'inherit' });
|
||||
|
||||
console.log('Migration completed successfully!');
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
console.error('Migration failed:', error.message);
|
||||
} else {
|
||||
console.error('Migration failed:', error);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user