feat: refs #7562 Fixes
This commit is contained in:
parent
912719cc08
commit
a27afbaa53
|
@ -127,12 +127,19 @@ class Version extends Command {
|
||||||
[opts.code, newVersion]
|
[opts.code, newVersion]
|
||||||
);
|
);
|
||||||
await fs.mkdir(newVersionDir);
|
await fs.mkdir(newVersionDir);
|
||||||
|
|
||||||
|
let content;
|
||||||
|
if (opts.deprecate) {
|
||||||
|
this.emit('deprecate');
|
||||||
|
content = await deprecate();
|
||||||
|
} else
|
||||||
|
content = '-- Place your SQL code here\n'
|
||||||
|
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
`${newVersionDir}/00-firstScript.sql`,
|
`${newVersionDir}/00-firstScript.sql`,
|
||||||
opts.deprecate
|
content
|
||||||
? this.emit('deprecate') && await deprecate()
|
|
||||||
: '-- Place your SQL code here\n'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.emit('versionCreated', versionFolder);
|
this.emit('versionCreated', versionFolder);
|
||||||
|
|
||||||
await conn.query('COMMIT');
|
await conn.query('COMMIT');
|
||||||
|
|
Loading…
Reference in New Issue