Release v2.6.20

This commit is contained in:
2026-08-09 12:18:44 +01:00
parent 459f84ed94
commit 39f2098ffe
7 changed files with 239 additions and 12 deletions
+10 -2
View File
@@ -1,3 +1,6 @@
const { version: appVersion } = require('#root/package.json');
const { compareVersions, detectSchemaVersion, recordSchemaVersion, runMigrations } = require('./migrations');
// Snapshot only: keep this file aligned with the current schema state.
async function ensureSchema(pool, options) {
const schemaLockName = 'pulse_signage_schema_lock';
@@ -12,6 +15,11 @@ async function ensureSchema(pool, options) {
}
try {
const currentVersion = await detectSchemaVersion(pool);
const updateRequired = compareVersions(currentVersion, appVersion) < 0;
console.info('[schema] previous=' + currentVersion + ' current=' + appVersion + ' update=' + (updateRequired ? 'yes' : 'no'));
await pool.query(`
CREATE TABLE IF NOT EXISTS c_canvas_sizes (
id INT AUTO_INCREMENT PRIMARY KEY,
@@ -384,8 +392,8 @@ async function ensureSchema(pool, options) {
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);
const { runMigrations } = require('./migrations');
await runMigrations(pool, options);
await runMigrations(pool, Object.assign({}, options, { currentVersion: currentVersion }));
await recordSchemaVersion(pool, appVersion);
} finally {
await pool.query('SELECT RELEASE_LOCK(?)', [schemaLockName]).catch(function () {
});