arkormx 2.12.16 → 2.12.17
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/cli.mjs +5 -7
- package/dist/index.cjs +5 -7
- package/dist/index.mjs +5 -7
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -5577,9 +5577,10 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
5577
5577
|
if (targets.length === 0) return void this.error("Error: No tracked migrations available to rollback.");
|
|
5578
5578
|
const available = await this.loadAllMigrations(migrationDirs);
|
|
5579
5579
|
const rollbackClasses = targets.map((target) => {
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5580
|
+
const byIdentity = available.find(([migrationClass, file]) => buildMigrationIdentity(file, migrationClass.name) === target.id);
|
|
5581
|
+
if (byIdentity) return [...byIdentity, target.id];
|
|
5582
|
+
const byClassName = available.filter(([migrationClass]) => migrationClass.name === target.className);
|
|
5583
|
+
return byClassName.length === 1 ? [...byClassName[0], target.id] : void 0;
|
|
5583
5584
|
}).filter((entry) => Boolean(entry));
|
|
5584
5585
|
if (rollbackClasses.length === 0) return void this.error("Error: Unable to resolve rollback migration classes from tracked history.");
|
|
5585
5586
|
if (this.option("dry-run")) {
|
|
@@ -5597,10 +5598,7 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
5597
5598
|
write: true
|
|
5598
5599
|
});
|
|
5599
5600
|
}
|
|
5600
|
-
for (const [
|
|
5601
|
-
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
5602
|
-
appliedState = removeAppliedMigration(appliedState, identity);
|
|
5603
|
-
}
|
|
5601
|
+
for (const [, , trackedId] of rollbackClasses) appliedState = removeAppliedMigration(appliedState, trackedId);
|
|
5604
5602
|
await writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState);
|
|
5605
5603
|
try {
|
|
5606
5604
|
await syncPersistedColumnMappingsFromState(process.cwd(), appliedState, available, persistedFeatures);
|
package/dist/index.cjs
CHANGED
|
@@ -4527,9 +4527,10 @@ var MigrateRollbackCommand = class extends _h3ravel_musket.Command {
|
|
|
4527
4527
|
if (targets.length === 0) return void this.error("Error: No tracked migrations available to rollback.");
|
|
4528
4528
|
const available = await this.loadAllMigrations(migrationDirs);
|
|
4529
4529
|
const rollbackClasses = targets.map((target) => {
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4530
|
+
const byIdentity = available.find(([migrationClass, file]) => require_relationship.buildMigrationIdentity(file, migrationClass.name) === target.id);
|
|
4531
|
+
if (byIdentity) return [...byIdentity, target.id];
|
|
4532
|
+
const byClassName = available.filter(([migrationClass]) => migrationClass.name === target.className);
|
|
4533
|
+
return byClassName.length === 1 ? [...byClassName[0], target.id] : void 0;
|
|
4533
4534
|
}).filter((entry) => Boolean(entry));
|
|
4534
4535
|
if (rollbackClasses.length === 0) return void this.error("Error: Unable to resolve rollback migration classes from tracked history.");
|
|
4535
4536
|
if (this.option("dry-run")) {
|
|
@@ -4547,10 +4548,7 @@ var MigrateRollbackCommand = class extends _h3ravel_musket.Command {
|
|
|
4547
4548
|
write: true
|
|
4548
4549
|
});
|
|
4549
4550
|
}
|
|
4550
|
-
for (const [
|
|
4551
|
-
const identity = require_relationship.buildMigrationIdentity(file, migrationClass.name);
|
|
4552
|
-
appliedState = require_relationship.removeAppliedMigration(appliedState, identity);
|
|
4553
|
-
}
|
|
4551
|
+
for (const [, , trackedId] of rollbackClasses) appliedState = require_relationship.removeAppliedMigration(appliedState, trackedId);
|
|
4554
4552
|
await require_relationship.writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState);
|
|
4555
4553
|
try {
|
|
4556
4554
|
await require_relationship.syncPersistedColumnMappingsFromState(process.cwd(), appliedState, available, persistedFeatures);
|
package/dist/index.mjs
CHANGED
|
@@ -4526,9 +4526,10 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
4526
4526
|
if (targets.length === 0) return void this.error("Error: No tracked migrations available to rollback.");
|
|
4527
4527
|
const available = await this.loadAllMigrations(migrationDirs);
|
|
4528
4528
|
const rollbackClasses = targets.map((target) => {
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4529
|
+
const byIdentity = available.find(([migrationClass, file]) => buildMigrationIdentity(file, migrationClass.name) === target.id);
|
|
4530
|
+
if (byIdentity) return [...byIdentity, target.id];
|
|
4531
|
+
const byClassName = available.filter(([migrationClass]) => migrationClass.name === target.className);
|
|
4532
|
+
return byClassName.length === 1 ? [...byClassName[0], target.id] : void 0;
|
|
4532
4533
|
}).filter((entry) => Boolean(entry));
|
|
4533
4534
|
if (rollbackClasses.length === 0) return void this.error("Error: Unable to resolve rollback migration classes from tracked history.");
|
|
4534
4535
|
if (this.option("dry-run")) {
|
|
@@ -4546,10 +4547,7 @@ var MigrateRollbackCommand = class extends Command {
|
|
|
4546
4547
|
write: true
|
|
4547
4548
|
});
|
|
4548
4549
|
}
|
|
4549
|
-
for (const [
|
|
4550
|
-
const identity = buildMigrationIdentity(file, migrationClass.name);
|
|
4551
|
-
appliedState = removeAppliedMigration(appliedState, identity);
|
|
4552
|
-
}
|
|
4550
|
+
for (const [, , trackedId] of rollbackClasses) appliedState = removeAppliedMigration(appliedState, trackedId);
|
|
4553
4551
|
await writeAppliedMigrationsStateToStore(adapter, stateFilePath, appliedState);
|
|
4554
4552
|
try {
|
|
4555
4553
|
await syncPersistedColumnMappingsFromState(process.cwd(), appliedState, available, persistedFeatures);
|