@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.
@@ -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
- this.fail(`The migration in ${written.file} failed its test. Fix the answers in ${written.planFile} or the .apsorc, then run apso migrate again.`, { file: written.file, planFile: written.planFile, steps: result.steps });
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)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.46.2",
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.2",
9
+ "version": "0.46.3",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@apso/schema-tools": "^0.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.46.2",
2
+ "version": "0.46.3",
3
3
  "commands": {
4
4
  "config": {
5
5
  "id": "config",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.46.2",
3
+ "version": "0.46.3",
4
4
  "mcpName": "io.github.apsoai/apso",
5
5
  "description": "Apso CLI",
6
6
  "author": "Apso by Mavric - @mavric",