This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { exec } from 'child_process'; | |
import { log } from 'console'; | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
import { Client } from 'pg'; // Assuming you have 'pg' npm package installed. | |
import * as util from 'util'; | |
const execPromise = util.promisify(exec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* generate-migration.ts | |
* | |
* This script generates a migration that moves the down.sql file to the latest migration folder. | |
* Use: | |
* ts-node generate-migration.ts <MIGRATION_NAME> | |
* yarn migrate:generate <MIGRATION_NAME> | |
*/ | |
import { execSync } from 'child_process'; | |
import { log } from 'console'; |