15 lines
376 B
JavaScript
15 lines
376 B
JavaScript
|
|
import { execSync } from "child_process";
|
||
|
|
|
||
|
|
const name = process.argv[2];
|
||
|
|
if (!name) {
|
||
|
|
console.error("Error: Migration name is required.");
|
||
|
|
process.exit(1);
|
||
|
|
}
|
||
|
|
|
||
|
|
execSync(
|
||
|
|
`npx sequelize-cli migration:generate --migrations-path database/migrations --config config/config.js --name ${name}`,
|
||
|
|
{ stdio: "inherit" }
|
||
|
|
);
|
||
|
|
|
||
|
|
execSync("node renameFiles.js", { stdio: "inherit" });
|