Add support for .migrations.json config file name
#45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds the capability for the config file to be named
.migrations.jsonin addition to.cfmigrations.json, providing a shorter, more generic naming option while maintaining full backward compatibility.Changes
New Default Config File Name
The
migrate initcommand now creates.migrations.jsonby default instead of.cfmigrations.json. This provides a cleaner, less verbose file name that still clearly indicates its purpose.Backward Compatibility
Existing projects using
.cfmigrations.jsonwill continue to work without any changes:.migrations.jsontakes priority (checked first)migrate initcommand checks for existing.cfmigrations.jsonbefore creating a new config to prevent duplicatesImplementation Details
Modified Files:
models/BaseMigrationCommand.cfc- Updated config file detection ingetCFMigrationsInfo()andgetCFMigrationsType()to check for both file namescommands/migrate/init.cfc- Changed to create.migrations.jsonby default with backward compatibility checksREADME.md- Updated documentation to reflect both supported file namesMigration Path
For existing projects:
.cfmigrations.jsoncontinues to work as before.cfmigrations.jsonto.migrations.jsonto use the new naming conventionFor new projects:
migrate initwill create.migrations.jsonautomaticallyTesting
All scenarios have been manually verified:
.migrations.jsondetection and usage.cfmigrations.jsonbackward compatibilitymigrate initprevents creating duplicate configsCloses #71
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.