@apso/cli 0.46.2 → 0.46.3
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/commands/migrate.js +10 -2
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/commands/migrate.js
CHANGED
|
@@ -124,8 +124,16 @@ class Migrate extends base_command_1.default {
|
|
|
124
124
|
verified = result.ok;
|
|
125
125
|
if (!this.json)
|
|
126
126
|
(0, verify_1.report)((s) => this.log(s), { ...result, findings: [] }, false);
|
|
127
|
-
if (!result.ok)
|
|
128
|
-
|
|
127
|
+
if (!result.ok) {
|
|
128
|
+
// Don't keep a migration that failed: the next run would read it as
|
|
129
|
+
// deployed and find nothing to migrate. The working plan keeps the
|
|
130
|
+
// answers and the baseline, so a rerun picks up where this one stopped.
|
|
131
|
+
for (const f of [written.file, written.planFile])
|
|
132
|
+
fs.rmSync(path.resolve(cwd, f), { force: true });
|
|
133
|
+
save();
|
|
134
|
+
const planRel = path.relative(cwd, planPath);
|
|
135
|
+
this.fail(`The migration failed its test, so it was not kept. Change an answer in ${planRel} or the .apsorc, then run apso migrate again. If the data loss is intended, rerun with --accept-loss <table.column>.`, { plan: planRel, steps: result.steps });
|
|
136
|
+
}
|
|
129
137
|
}
|
|
130
138
|
this.say(`\nReview and commit ${written.file} and ${written.planFile}, then deploy.`);
|
|
131
139
|
if (verified === true && !flags.seed)
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apso/cli",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@apso/cli",
|
|
9
|
-
"version": "0.46.
|
|
9
|
+
"version": "0.46.3",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apso/schema-tools": "^0.2.0",
|
package/oclif.manifest.json
CHANGED