MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / pushEqualityListCondition

Function pushEqualityListCondition

main.js:3459–3492  ·  view source on GitHub ↗

Multi-value designer / parentModel / license (matches legacy single-value SQL for invert + NULL).

(conditions, params, column, values, combineOp, inverted, useLowerTrim)

Source from the content-addressed store, hash-verified

3457/** Add rating (0-5) and favorite (0/1) columns for model engagement. */
3458function migrateRatingFavoriteColumns() {
3459 try {
3460 console.log('Checking for rating/favorite column migration...');
3461 const tableInfo = db.prepare('PRAGMA table_info(models)').all();
3462 const hasRating = tableInfo.some(col => col.name === 'rating');
3463 const hasFavorite = tableInfo.some(col => col.name === 'favorite');
3464 if (!hasRating) {
3465 console.log('rating column not found. Adding it...');
3466 db.prepare('ALTER TABLE models ADD COLUMN rating INTEGER DEFAULT 0').run();
3467 db.prepare('UPDATE models SET rating = 0 WHERE rating IS NULL').run();
3468 }
3469 if (!hasFavorite) {
3470 console.log('favorite column not found. Adding it...');
3471 db.prepare('ALTER TABLE models ADD COLUMN favorite INTEGER DEFAULT 0').run();
3472 db.prepare('UPDATE models SET favorite = 0 WHERE favorite IS NULL').run();
3473 }
3474 return true;
3475 } catch (error) {
3476 console.error('Error migrating rating/favorite columns:', error);
3477 return false;
3478 }
3479}
3480
3481function migratePrintLifecycleColumns() {
3482 try {
3483 printEvents.migratePrintLifecycle(db);
3484 return true;
3485 } catch (error) {
3486 console.error('Error migrating print lifecycle columns:', error);
3487 return false;
3488 }
3489}
3490
3491/** Zip bundle columns for grouped browsing (folder siblings are not bundled). */
3492function migrateBundleColumns() {
3493 try {
3494 console.log('Checking for bundle column migration...');
3495 const tableInfo = db.prepare('PRAGMA table_info(models)').all();

Callers 2

getModelsFilteredHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected