@inforge/migrations-tools-cli 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -465,12 +465,20 @@ var TriggersHandler = class {
|
|
|
465
465
|
await this.updateStatus(connection, triggerNames, "Active");
|
|
466
466
|
}
|
|
467
467
|
async updateStatus(connection, triggerNames, status) {
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
const query = `
|
|
469
|
+
SELECT Id, Name
|
|
470
|
+
FROM ApexTrigger
|
|
471
|
+
WHERE Name IN (${triggerNames.map((n) => `'${n}'`).join(", ")})
|
|
472
|
+
`;
|
|
473
|
+
const result = await connection.tooling.query(query);
|
|
474
|
+
if (result.records.length === 0) {
|
|
475
|
+
throw new Error("No triggers found with the specified names");
|
|
476
|
+
}
|
|
477
|
+
const updates = result.records.map((trigger) => ({
|
|
478
|
+
Id: trigger.Id,
|
|
479
|
+
Status: status
|
|
472
480
|
}));
|
|
473
|
-
const results = await connection.
|
|
481
|
+
const results = await connection.tooling.update("ApexTrigger", updates);
|
|
474
482
|
if (Array.isArray(results)) {
|
|
475
483
|
const failures = results.filter((r) => !r.success);
|
|
476
484
|
if (failures.length > 0) {
|
package/package.json
CHANGED