From a3e7de97ec3e8e1ec7d1ac89b9623e7703d1ce9f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:25:49 +0000 Subject: [PATCH 1/3] Initial plan From 1b6c5e9274cce1fe7413aab6d646ff4989e81f05 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:28:47 +0000 Subject: [PATCH 2/3] Add support for .migrations.json config file name Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com> --- commands/migrate/init.cfc | 13 ++++++++++--- models/BaseMigrationCommand.cfc | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/commands/migrate/init.cfc b/commands/migrate/init.cfc index 4eb8ea1..cdb179b 100644 --- a/commands/migrate/init.cfc +++ b/commands/migrate/init.cfc @@ -12,10 +12,17 @@ component { function run( boolean open = false ) { var directory = getCWD(); - var configPath = "#directory#/.cfmigrations.json"; + var configPath = "#directory#/.migrations.json"; - // Check and see if a .cfmigrations.json file exists + // Check and see if a .migrations.json file exists if ( fileExists( configPath ) ) { + print.yellowLine( ".migrations.json already exists." ); + return; + } + + // Check and see if a .cfmigrations.json file exists (for backward compatibility) + var oldConfigPath = "#directory#/.cfmigrations.json"; + if ( fileExists( oldConfigPath ) ) { print.yellowLine( ".cfmigrations.json already exists." ); return; } @@ -24,7 +31,7 @@ component { file action="write" file="#configPath#" mode="777" output="#trim( configStub )#"; - print.greenLine( "Created .cfmigrations config file." ); + print.greenLine( "Created .migrations config file." ); // Open file? if ( arguments.open ) { diff --git a/models/BaseMigrationCommand.cfc b/models/BaseMigrationCommand.cfc index 1c52892..e717b7b 100644 --- a/models/BaseMigrationCommand.cfc +++ b/models/BaseMigrationCommand.cfc @@ -76,7 +76,15 @@ component { var directory = getCWD(); - // Check and see if a .cfmigrations.json file exists + // Check and see if a .migrations.json file exists + if ( fileExists( "#directory#/.migrations.json" ) ) { + var cfmigrationsInfo = deserializeJSON( fileRead( "#directory#/.migrations.json" ) ); + variables.systemSettings.expandDeepSystemSettings( cfmigrationsInfo ); + cfmigrationsInfoType = "cfmigrations"; + return cfmigrationsInfo; + } + + // Check and see if a .cfmigrations.json file exists (for backward compatibility) if ( fileExists( "#directory#/.cfmigrations.json" ) ) { var cfmigrationsInfo = deserializeJSON( fileRead( "#directory#/.cfmigrations.json" ) ); variables.systemSettings.expandDeepSystemSettings( cfmigrationsInfo ); @@ -134,7 +142,12 @@ component { private string function getCFMigrationsType() { var directory = getCWD(); - // Check and see if a .cfmigrations.json file exists + // Check and see if a .migrations.json file exists + if ( fileExists( "#directory#/.migrations.json" ) ) { + return "cfmigrations"; + } + + // Check and see if a .cfmigrations.json file exists (for backward compatibility) if ( fileExists( "#directory#/.cfmigrations.json" ) ) { return "cfmigrations"; } From 02c9f09e0a1db2c8ca49fa09f1f255718c222350 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:29:47 +0000 Subject: [PATCH 3/3] Update documentation to reflect .migrations.json support Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com> --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f83eb8e..3bf4ffd 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ v4 brings a new configuration structure and file. This pairs with new features in CFMigrations to allow for multiple named migration managers and new seeding capabilities. Migrations will still run in v4 using the old configuration structure and location, but it is highly recommended you upgrade. -You can create the new `.cfmigrations.json` config file by running `migrate init`. +You can create the new config file by running `migrate init`. The file can be named either `.migrations.json` or `.cfmigrations.json` (both are supported for backward compatibility). The new config file format mirrors `CFMigrations`: @@ -84,7 +84,9 @@ Make sure to append `@qb` to the end of any qb-supplied grammars, like `AutoDisc ## Setup -You need to create a `.cfmigrations.json` config file in your application root folder. You can do this easily by running `migrate init`: +You need to create a config file in your application root folder. You can do this easily by running `migrate init`. + +The config file can be named either `.migrations.json` or `.cfmigrations.json` (both are supported for backward compatibility). ```json { @@ -211,7 +213,8 @@ You would update your `.gitignore` file to not ignore the `.env.example` file: ### `migrate init` -Creates the migration config file as `.cfmigrations.json`, if it doesn't already exist. +Creates the migration config file as `.migrations.json`, if it doesn't already exist. +(The older `.cfmigrations.json` name is also supported for backward compatibility.) ### `migrate install`