Push.updateVersion() fixes

This commit is contained in:
Juan Ferrer 2022-02-07 15:54:24 +01:00
parent 193588da45
commit ad32530261
2 changed files with 5 additions and 8 deletions

View File

@ -201,7 +201,7 @@ class Push {
nChanges++;
}
await this.updateVersion(nChanges, 'number', versionNumber);
await this.updateVersion('number', versionNumber);
}
}
@ -323,7 +323,7 @@ class Push {
const head = await repo.getHeadCommit();
if (version.gitCommit !== head.sha())
await this.updateVersion(nRoutines, 'gitCommit', head.sha());
await this.updateVersion('gitCommit', head.sha());
// Update and release
@ -339,10 +339,7 @@ class Push {
return routines;
}
async updateVersion(nChanges, column, value) {
if (nChanges == 0) return;
const {opts} = this;
async updateVersion(column, value) {
column = this.conn.escapeId(column, true);
await this.conn.query(
`INSERT INTO version
@ -353,7 +350,7 @@ class Push {
${column} = VALUES(${column}),
updated = VALUES(updated)`,
[
opts.code,
this.opts.code,
value
]
);

View File

@ -1,6 +1,6 @@
{
"name": "myvc",
"version": "1.2.8",
"version": "1.2.9",
"author": "Verdnatura Levante SL",
"description": "MySQL Version Control",
"license": "GPL-3.0",