Skip to content

Conversation

Copy link

Copilot AI commented Sep 30, 2025

Overview

This PR adds the capability for the config file to be named .migrations.json in addition to .cfmigrations.json, providing a shorter, more generic naming option while maintaining full backward compatibility.

Changes

New Default Config File Name

The migrate init command now creates .migrations.json by 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.json will continue to work without any changes:

  • Both file names are supported and automatically detected
  • When both files exist, .migrations.json takes priority (checked first)
  • The migrate init command checks for existing .cfmigrations.json before creating a new config to prevent duplicates

Implementation Details

Modified Files:

  • models/BaseMigrationCommand.cfc - Updated config file detection in getCFMigrationsInfo() and getCFMigrationsType() to check for both file names
  • commands/migrate/init.cfc - Changed to create .migrations.json by default with backward compatibility checks
  • README.md - Updated documentation to reflect both supported file names

Migration Path

For existing projects:

  • No action required - .cfmigrations.json continues to work as before
  • Optional - Rename .cfmigrations.json to .migrations.json to use the new naming convention

For new projects:

  • migrate init will create .migrations.json automatically

Testing

All scenarios have been manually verified:

  • .migrations.json detection and usage
  • .cfmigrations.json backward compatibility
  • ✓ Priority handling when both files exist
  • migrate init prevents creating duplicate configs

Closes #71

Original prompt

This section details on the original issue you should resolve

<issue_title>The config file can be named .cfmigrations or just .migrations</issue_title>
<issue_description>Add the capability for the config file to also be called .migrations with no designation to cf.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #44

💡 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.

Copilot AI and others added 2 commits September 30, 2025 15:28
Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com>
Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com>
Copilot AI changed the title [WIP] The config file can be named .cfmigrations or just .migrations Add support for .migrations.json config file name Sep 30, 2025
Copilot AI requested a review from lmajano September 30, 2025 15:33
@lmajano
Copy link
Contributor

lmajano commented Oct 2, 2025

@copilot Update it to use .cbmigrations as the new standard instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The config file can be named .cfmigrations or just .migrations

2 participants