Release v2.17.5
This commit is contained in:
1 parent
46636939de
commit
86b9609ea7
11 files changed
+285
-56
No files matched your search
@@ -49,6 +49,37 @@ test('pending migrations are empty when the schema already matches the app versi
|
||||
assert.equal(pendingMigrations.length, 0);
|
||||
});
|
||||
|
||||
test('query index migration upgrades a 2.17.4 installation', async () => {
|
||||
const queries = [];
|
||||
const pool = {
|
||||
queries,
|
||||
async query(sql, params) {
|
||||
queries.push([sql, params]);
|
||||
if (String(sql).includes('FROM information_schema.STATISTICS')) {
|
||||
return [[{ index_count: params[1] === 'idx_background_tasks_status' ? 1 : 0 }]];
|
||||
}
|
||||
return [[]];
|
||||
}
|
||||
};
|
||||
const pending = await getPendingMigrations(pool, { currentVersion: '2.17.4' });
|
||||
const indexMigration = pending.find(migration => migration.version === '2.17.5');
|
||||
|
||||
assert.ok(indexMigration);
|
||||
await indexMigration.run(pool);
|
||||
|
||||
const alterations = queries.map(([sql]) => String(sql)).filter(sql => sql.startsWith('ALTER TABLE'));
|
||||
assert.equal(alterations.length, 9);
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_playlist_slides_playlist_position')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_template_regions_template_z')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_slides_template')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_templates_canvas_size')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_sessions_expires_at')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_background_tasks_status_created_at')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_rss_feeds_modified_at')));
|
||||
assert.ok(alterations.some(sql => sql.includes('ADD INDEX idx_api_source_groups_modified_at')));
|
||||
assert.ok(alterations.some(sql => sql.includes('DROP INDEX idx_background_tasks_status')));
|
||||
});
|
||||
|
||||
test('playlist shuffle migration upgrades an existing 2.15.0 installation', async () => {
|
||||
const pool = createPool([]);
|
||||
const pending = await getPendingMigrations(pool, { currentVersion: '2.15.0' });
|
||||
|
||||
Reference in new issue
Block a user