Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/db.3/
Upload File :
Current File : /home/infinitibizsol/.trash/db.3/updateDb.js

import db from "../model/index";
async function updateDbCollections() {
  try {
    // Fetch all systems
    const systems = await db.System.find();

    // Iterate over each system and update the fields
    for (let system of systems) {
      system.guided_workflow = system.guided_workflow === false || false;
      system.popup_important_notes =
        system.popup_important_notes === false || false;
      await system.save();
    }

    console.log("Field renamed successfully");
  } catch (err) {
    console.error("Error during migration:", err.message);
  }
}

export default updateDbCollections;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists