arkormx 2.8.0 → 2.8.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/cli.mjs +10 -6
- package/dist/index.cjs +10 -6
- package/dist/index.mjs +10 -6
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4053,6 +4053,7 @@ var MigrateCommand = class extends Command {
|
|
|
4053
4053
|
*/
|
|
4054
4054
|
async handle() {
|
|
4055
4055
|
this.app.command = this;
|
|
4056
|
+
await loadArkormConfig();
|
|
4056
4057
|
const configuredMigrationsDir = this.app.getConfig("paths")?.migrations ?? join(process.cwd(), "database", "migrations");
|
|
4057
4058
|
const migrationDirs = this.resolveMigrationDirectories(configuredMigrationsDir);
|
|
4058
4059
|
if (migrationDirs.length === 0 && getRegisteredMigrations().length === 0) return void this.error(`Error: Migrations directory not found: ${this.app.formatPathForLog(configuredMigrationsDir)}`);
|
|
@@ -4093,14 +4094,17 @@ var MigrateCommand = class extends Command {
|
|
|
4093
4094
|
this.success("No pending migration classes to apply.");
|
|
4094
4095
|
return;
|
|
4095
4096
|
}
|
|
4096
|
-
|
|
4097
|
-
await validatePersistedMetadataFeaturesForMigrations(pending, persistedFeatures);
|
|
4098
|
-
} catch (error) {
|
|
4099
|
-
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4100
|
-
return;
|
|
4101
|
-
}
|
|
4097
|
+
let columnMappingsState = createEmptyPersistedColumnMappingsState();
|
|
4102
4098
|
for (const [MigrationClassItem] of pending) {
|
|
4103
4099
|
if (useDatabaseMigrations) {
|
|
4100
|
+
const planned = await this.runWithDatabaseCreationRetry(adapter, () => getMigrationPlan(MigrationClassItem, "up"));
|
|
4101
|
+
if (!planned.ok) return;
|
|
4102
|
+
try {
|
|
4103
|
+
columnMappingsState = applyOperationsToPersistedColumnMappingsState(columnMappingsState, planned.value, persistedFeatures);
|
|
4104
|
+
} catch (error) {
|
|
4105
|
+
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4106
|
+
return;
|
|
4107
|
+
}
|
|
4104
4108
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem))).ok) return;
|
|
4105
4109
|
continue;
|
|
4106
4110
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -3323,6 +3323,7 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
3323
3323
|
*/
|
|
3324
3324
|
async handle() {
|
|
3325
3325
|
this.app.command = this;
|
|
3326
|
+
await require_relationship.loadArkormConfig();
|
|
3326
3327
|
const configuredMigrationsDir = this.app.getConfig("paths")?.migrations ?? (0, node_path.join)(process.cwd(), "database", "migrations");
|
|
3327
3328
|
const migrationDirs = this.resolveMigrationDirectories(configuredMigrationsDir);
|
|
3328
3329
|
if (migrationDirs.length === 0 && require_relationship.getRegisteredMigrations().length === 0) return void this.error(`Error: Migrations directory not found: ${this.app.formatPathForLog(configuredMigrationsDir)}`);
|
|
@@ -3363,14 +3364,17 @@ var MigrateCommand = class extends _h3ravel_musket.Command {
|
|
|
3363
3364
|
this.success("No pending migration classes to apply.");
|
|
3364
3365
|
return;
|
|
3365
3366
|
}
|
|
3366
|
-
|
|
3367
|
-
await require_relationship.validatePersistedMetadataFeaturesForMigrations(pending, persistedFeatures);
|
|
3368
|
-
} catch (error) {
|
|
3369
|
-
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3370
|
-
return;
|
|
3371
|
-
}
|
|
3367
|
+
let columnMappingsState = require_relationship.createEmptyPersistedColumnMappingsState();
|
|
3372
3368
|
for (const [MigrationClassItem] of pending) {
|
|
3373
3369
|
if (useDatabaseMigrations) {
|
|
3370
|
+
const planned = await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.getMigrationPlan(MigrationClassItem, "up"));
|
|
3371
|
+
if (!planned.ok) return;
|
|
3372
|
+
try {
|
|
3373
|
+
columnMappingsState = require_relationship.applyOperationsToPersistedColumnMappingsState(columnMappingsState, planned.value, persistedFeatures);
|
|
3374
|
+
} catch (error) {
|
|
3375
|
+
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3376
|
+
return;
|
|
3377
|
+
}
|
|
3374
3378
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => require_relationship.applyMigrationToDatabase(adapter, MigrationClassItem))).ok) return;
|
|
3375
3379
|
continue;
|
|
3376
3380
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3322,6 +3322,7 @@ var MigrateCommand = class extends Command {
|
|
|
3322
3322
|
*/
|
|
3323
3323
|
async handle() {
|
|
3324
3324
|
this.app.command = this;
|
|
3325
|
+
await loadArkormConfig();
|
|
3325
3326
|
const configuredMigrationsDir = this.app.getConfig("paths")?.migrations ?? join(process.cwd(), "database", "migrations");
|
|
3326
3327
|
const migrationDirs = this.resolveMigrationDirectories(configuredMigrationsDir);
|
|
3327
3328
|
if (migrationDirs.length === 0 && getRegisteredMigrations().length === 0) return void this.error(`Error: Migrations directory not found: ${this.app.formatPathForLog(configuredMigrationsDir)}`);
|
|
@@ -3362,14 +3363,17 @@ var MigrateCommand = class extends Command {
|
|
|
3362
3363
|
this.success("No pending migration classes to apply.");
|
|
3363
3364
|
return;
|
|
3364
3365
|
}
|
|
3365
|
-
|
|
3366
|
-
await validatePersistedMetadataFeaturesForMigrations(pending, persistedFeatures);
|
|
3367
|
-
} catch (error) {
|
|
3368
|
-
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3369
|
-
return;
|
|
3370
|
-
}
|
|
3366
|
+
let columnMappingsState = createEmptyPersistedColumnMappingsState();
|
|
3371
3367
|
for (const [MigrationClassItem] of pending) {
|
|
3372
3368
|
if (useDatabaseMigrations) {
|
|
3369
|
+
const planned = await this.runWithDatabaseCreationRetry(adapter, () => getMigrationPlan(MigrationClassItem, "up"));
|
|
3370
|
+
if (!planned.ok) return;
|
|
3371
|
+
try {
|
|
3372
|
+
columnMappingsState = applyOperationsToPersistedColumnMappingsState(columnMappingsState, planned.value, persistedFeatures);
|
|
3373
|
+
} catch (error) {
|
|
3374
|
+
this.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3373
3377
|
if (!(await this.runWithDatabaseCreationRetry(adapter, () => applyMigrationToDatabase(adapter, MigrationClassItem))).ok) return;
|
|
3374
3378
|
continue;
|
|
3375
3379
|
}
|