feat: refs #7562 Fixes

This commit is contained in:
Guillermo Bonet 2024-09-04 15:04:45 +02:00
parent 912719cc08
commit a27afbaa53
1 changed files with 10 additions and 3 deletions

View File

@ -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');