@mostajs/orm-cli 0.5.11 → 0.5.12
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/bin/mostajs.sh +11 -11
- package/package.json +1 -1
package/bin/mostajs.sh
CHANGED
|
@@ -2120,19 +2120,19 @@ action_rep_promote() {
|
|
|
2120
2120
|
# is just a role swap in the JSON — no DB connection needed.
|
|
2121
2121
|
_tree_patch "
|
|
2122
2122
|
const reps = tree.replicas['$project'];
|
|
2123
|
-
if (!reps) { console.log(' ✗ project \"$project\" not found');
|
|
2124
|
-
if (!reps['$name']) { console.log(' ✗ replica \"$name\" not found in $project');
|
|
2125
|
-
if (reps['$name'].role === 'master') { console.log(' • $name is already master');
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2123
|
+
if (!reps) { console.log(' ✗ project \"$project\" not found'); }
|
|
2124
|
+
else if (!reps['$name']) { console.log(' ✗ replica \"$name\" not found in $project'); }
|
|
2125
|
+
else if (reps['$name'].role === 'master') { console.log(' • $name is already master'); }
|
|
2126
|
+
else {
|
|
2127
|
+
for (const [n, cfg] of Object.entries(reps)) {
|
|
2128
|
+
if (cfg.role === 'master') {
|
|
2129
|
+
cfg.role = 'slave';
|
|
2130
|
+
console.log(' ↓ ' + n + ' demoted to slave');
|
|
2131
|
+
}
|
|
2131
2132
|
}
|
|
2133
|
+
reps['$name'].role = 'master';
|
|
2134
|
+
console.log(' ★ $name promoted to master');
|
|
2132
2135
|
}
|
|
2133
|
-
// Promote target to master
|
|
2134
|
-
reps['$name'].role = 'master';
|
|
2135
|
-
console.log(' ★ $name promoted to master');
|
|
2136
2136
|
"
|
|
2137
2137
|
pause
|
|
2138
2138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostajs/orm-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "Universal CLI to integrate @mostajs/orm into any project — one-shot `mostajs bootstrap` migrates a Prisma project (codemod + deps + schema convert + DDL) to 13 databases with zero code change.",
|
|
5
5
|
"author": "Dr Hamid MADANI <drmdh@msn.com>",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|