Skip to content

Commit 7f076c3

Browse files
committed
feat!: rename module from cfmigrations to cbMigrations
BREAKING CHANGE: the module is renamed from `cfmigrations` to `cbMigrations` to match the Ortus `cbXxx` naming convention. This changes the module name, ForgeBox slug, WireBox mappings (`cbMigrations.models.QBMigrationManager`), the DSL injection name (`MigrationService@cbMigrations`), and the moduleSettings key (`cbMigrations`). The default migrations tracking table also renames from `cfmigrations` to `cbmigrations` — `install()` now detects a legacy `cfmigrations` table and renames it in place so existing migration history carries forward automatically. GitHub links in box.json and README now point at coldbox-modules/cbMigrations ahead of the planned repository rename. Also drops CI/test support for the EOL Adobe 2021 and Lucee 5 engines. https://claude.ai/code/session_01BN233VRgXRMBvRxQNyqTJt
1 parent 1a207e3 commit 7f076c3

27 files changed

Lines changed: 136 additions & 157 deletions

.cfconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"clientManagement":"no",
88
"datasourcePreserveSingleQuotes":"false",
99
"datasources":{
10-
"cfmigrations_testing":{
10+
"cbmigrations_testing":{
1111
"allowAlter":true,
1212
"allowCreate":true,
1313
"allowDelete":true,

.github/workflows/cron.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
cfengine: ["lucee@5", "lucee@6", "adobe@2021", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
14+
cfengine: ["lucee@6", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
1515
experimental: [false]
1616
coldbox: ["coldbox@6", "coldbox@7", "coldbox@be"]
1717
include:
@@ -29,9 +29,9 @@ jobs:
2929
postgres:
3030
image: postgres:12
3131
env:
32-
POSTGRES_USER: cfmigrations_testing
33-
POSTGRES_PASSWORD: cfmigrations_testing
34-
POSTGRES_DB: cfmigrations_testing
32+
POSTGRES_USER: cbmigrations_testing
33+
POSTGRES_PASSWORD: cbmigrations_testing
34+
POSTGRES_DB: cbmigrations_testing
3535
ports:
3636
- 5432
3737
options: >-
@@ -59,9 +59,9 @@ jobs:
5959
env:
6060
DB_HOST: localhost
6161
DB_PORT: ${{ job.services.postgres.ports[5432] }}
62-
DB_NAME: cfmigrations_testing
63-
DB_USER: cfmigrations_testing
64-
DB_PASSWORD: cfmigrations_testing
62+
DB_NAME: cbmigrations_testing
63+
DB_USER: cbmigrations_testing
64+
DB_PASSWORD: cbmigrations_testing
6565
run: |
6666
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
6767
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
@@ -76,9 +76,9 @@ jobs:
7676
env:
7777
DB_HOST: localhost
7878
DB_PORT: ${{ job.services.postgres.ports[5432] }}
79-
DB_NAME: cfmigrations_testing
80-
DB_USER: cfmigrations_testing
81-
DB_PASSWORD: cfmigrations_testing
79+
DB_NAME: cbmigrations_testing
80+
DB_USER: cbmigrations_testing
81+
DB_PASSWORD: cbmigrations_testing
8282
run: |
8383
box server restart serverConfigFile="server-${{ matrix.cfengine }}.json" --debug
8484
sleep 30
@@ -87,8 +87,8 @@ jobs:
8787
env:
8888
DB_HOST: localhost
8989
DB_PORT: ${{ job.services.postgres.ports[5432] }}
90-
DB_NAME: cfmigrations_testing
91-
DB_USER: cfmigrations_testing
92-
DB_PASSWORD: cfmigrations_testing
90+
DB_NAME: cbmigrations_testing
91+
DB_USER: cbmigrations_testing
92+
DB_PASSWORD: cbmigrations_testing
9393
continue-on-error: ${{ matrix.experimental }}
9494
run: box testbox run

.github/workflows/pr.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
cfengine: ["lucee@5", "lucee@6", "adobe@2021", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
22+
cfengine: ["lucee@6", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
2323
experimental: [ false ]
2424
coldbox: ["coldbox@6", "coldbox@7"]
2525
include:
@@ -37,9 +37,9 @@ jobs:
3737
postgres:
3838
image: postgres:12
3939
env:
40-
POSTGRES_USER: cfmigrations_testing
41-
POSTGRES_PASSWORD: cfmigrations_testing
42-
POSTGRES_DB: cfmigrations_testing
40+
POSTGRES_USER: cbmigrations_testing
41+
POSTGRES_PASSWORD: cbmigrations_testing
42+
POSTGRES_DB: cbmigrations_testing
4343
ports:
4444
- 5432
4545
options: >-
@@ -67,9 +67,9 @@ jobs:
6767
env:
6868
DB_HOST: localhost
6969
DB_PORT: ${{ job.services.postgres.ports[5432] }}
70-
DB_NAME: cfmigrations_testing
71-
DB_USER: cfmigrations_testing
72-
DB_PASSWORD: cfmigrations_testing
70+
DB_NAME: cbmigrations_testing
71+
DB_USER: cbmigrations_testing
72+
DB_PASSWORD: cbmigrations_testing
7373
run: |
7474
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
7575
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
@@ -84,9 +84,9 @@ jobs:
8484
env:
8585
DB_HOST: localhost
8686
DB_PORT: ${{ job.services.postgres.ports[5432] }}
87-
DB_NAME: cfmigrations_testing
88-
DB_USER: cfmigrations_testing
89-
DB_PASSWORD: cfmigrations_testing
87+
DB_NAME: cbmigrations_testing
88+
DB_USER: cbmigrations_testing
89+
DB_PASSWORD: cbmigrations_testing
9090
run: |
9191
box server restart serverConfigFile="server-${{ matrix.cfengine }}.json" --debug
9292
sleep 30
@@ -95,9 +95,9 @@ jobs:
9595
env:
9696
DB_HOST: localhost
9797
DB_PORT: ${{ job.services.postgres.ports[5432] }}
98-
DB_NAME: cfmigrations_testing
99-
DB_USER: cfmigrations_testing
100-
DB_PASSWORD: cfmigrations_testing
98+
DB_NAME: cbmigrations_testing
99+
DB_USER: cbmigrations_testing
100+
DB_PASSWORD: cbmigrations_testing
101101
continue-on-error: ${{ matrix.experimental }}
102102
run: box testbox run
103103

.github/workflows/release.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
cfengine: ["lucee@5", "lucee@6", "adobe@2021", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
17+
cfengine: ["lucee@6", "adobe@2023", "adobe@2025", "boxlang-cfml@1"]
1818
experimental: [false]
1919
coldbox: ["coldbox@6", "coldbox@7"]
2020
services:
2121
postgres:
2222
image: postgres:12
2323
env:
24-
POSTGRES_USER: cfmigrations_testing
25-
POSTGRES_PASSWORD: cfmigrations_testing
26-
POSTGRES_DB: cfmigrations_testing
24+
POSTGRES_USER: cbmigrations_testing
25+
POSTGRES_PASSWORD: cbmigrations_testing
26+
POSTGRES_DB: cbmigrations_testing
2727
ports:
2828
- 5432
2929
options: >-
@@ -54,9 +54,9 @@ jobs:
5454
env:
5555
DB_HOST: localhost
5656
DB_PORT: ${{ job.services.postgres.ports[5432] }}
57-
DB_NAME: cfmigrations_testing
58-
DB_USER: cfmigrations_testing
59-
DB_PASSWORD: cfmigrations_testing
57+
DB_NAME: cbmigrations_testing
58+
DB_USER: cbmigrations_testing
59+
DB_PASSWORD: cbmigrations_testing
6060
run: |
6161
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
6262
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
@@ -71,9 +71,9 @@ jobs:
7171
env:
7272
DB_HOST: localhost
7373
DB_PORT: ${{ job.services.postgres.ports[5432] }}
74-
DB_NAME: cfmigrations_testing
75-
DB_USER: cfmigrations_testing
76-
DB_PASSWORD: cfmigrations_testing
74+
DB_NAME: cbmigrations_testing
75+
DB_USER: cbmigrations_testing
76+
DB_PASSWORD: cbmigrations_testing
7777
run: |
7878
box server restart serverConfigFile="server-${{ matrix.cfengine }}.json" --debug
7979
sleep 30
@@ -82,9 +82,9 @@ jobs:
8282
env:
8383
DB_HOST: localhost
8484
DB_PORT: ${{ job.services.postgres.ports[5432] }}
85-
DB_NAME: cfmigrations_testing
86-
DB_USER: cfmigrations_testing
87-
DB_PASSWORD: cfmigrations_testing
85+
DB_NAME: cbmigrations_testing
86+
DB_USER: cbmigrations_testing
87+
DB_PASSWORD: cbmigrations_testing
8888
run: box testbox run
8989

9090
release:

ModuleConfig.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
component {
22

3-
this.name = "cfmigrations";
3+
this.name = "cbMigrations";
44
this.author = "Eric Peterson";
55
this.description = "Keep track and run your database migrations with CFML";
66
this.version = "0.0.0";
7-
this.cfmapping = "cfmigrations";
7+
this.cfmapping = "cbMigrations";
88
this.dependencies = [ "qb" ];
99

1010
function configure() {
1111
settings = {
1212
"managers": {
1313
"default": {
14-
"manager": "cfmigrations.models.QBMigrationManager",
14+
"manager": "cbMigrations.models.QBMigrationManager",
1515
"properties": { "defaultGrammar": "AutoDiscover@qb" }
1616
}
1717
}

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cfmigrations
1+
# cbMigrations
22

33
## Keep track and run your database migrations with CFML.
44

@@ -32,7 +32,7 @@ component {
3232

3333
> **Warning:** The `pretend` feature only works with `qb`'s `SchemaBuilder` and `QueryBuilder`. It does **not** work with `queryExecute` or any other method of executing SQL. If your migration uses `queryExecute`, the `pretend` flag will have no effect and the SQL will be executed normally.
3434
35-
The name of this file could be something like `2017_09_03_043150_create_users_table.cfc`. The first 17 characters of this file represent the timestamp of the migration and need to be in this format: `YYYY_MM_DD_HHMISS`. The reason for this is so `cfmigrations` can run the migrations in the correct order. You may have migrations that add columns to a table, so you need to make sure the table exists first. In this case, just make sure the timestamp for adding the new column comes after the timestamp for creating the table, like so:
35+
The name of this file could be something like `2017_09_03_043150_create_users_table.cfc`. The first 17 characters of this file represent the timestamp of the migration and need to be in this format: `YYYY_MM_DD_HHMISS`. The reason for this is so `cbMigrations` can run the migrations in the correct order. You may have migrations that add columns to a table, so you need to make sure the table exists first. In this case, just make sure the timestamp for adding the new column comes after the timestamp for creating the table, like so:
3636

3737
```
3838
2017_09_03_043150_create_users_table.cfc
@@ -43,23 +43,23 @@ An easy way to generate these files is to use `commandbox-migrations` and the `m
4343

4444
### Installation and Uninstallation
4545

46-
In order to track which migrations have been ran, `cfmigrations` needs to install a tracking mechanism. For database migrations this creates a table in your database called `cfmigrations` by default. You can do this by calling the `install()` method or by running the `migrate install` command from `commandbox-migrations`.
46+
In order to track which migrations have been ran, `cbMigrations` needs to install a tracking mechanism. For database migrations this creates a table in your database called `cbmigrations` by default. You can do this by calling the `install()` method or by running the `migrate install` command from `commandbox-migrations`.
4747

4848
If you find a need to, you can uninstall the migrations tracker by calling the `uninstall()` method or by running `migrate uninstall` from `commandbox-migrations`. Running this method will rollback all ran migrations before removing the migrations tracker.
4949

5050
### Configuration
5151

52-
The module is configured by default with a single migration service that interact with your database, optionally using qb. Multiple migration services with different managers may also be configured. The default manager for the cfmigrations is `QBMigrationManager`, but you may use others, such as those included with the `cbmongodb` and `cbelasticsearch` modules or roll your own.
52+
The module is configured by default with a single migration service that interact with your database, optionally using qb. Multiple migration services with different managers may also be configured. The default manager for cbMigrations is `QBMigrationManager`, but you may use others, such as those included with the `cbmongodb` and `cbelasticsearch` modules or roll your own.
5353

5454
The default configuration for the module settings are:
5555

5656
```cfc
5757
moduleSettings = {
58-
"cfmigrations" : {
58+
"cbMigrations" : {
5959
"managers" : {
6060
"default" : {
6161
// The manager handling and executing the migration files
62-
"manager" : "cfmigrations.models.QBMigrationManager",
62+
"manager" : "cbMigrations.models.QBMigrationManager",
6363
// The directory containing the migration files
6464
"migrationsDirectory" : "/resources/database/migrations",
6565
// The directory containing any seeds, if applicable
@@ -81,10 +81,10 @@ Here is an example of a multi-manager migrations system. Each separate manager
8181

8282
```cfc
8383
moduleSettings = {
84-
"cfmigrations": {
84+
"cbMigrations": {
8585
"managers": {
8686
"db1": {
87-
"manager": "cfmigrations.models.QBMigrationManager",
87+
"manager": "cbMigrations.models.QBMigrationManager",
8888
"migrationsDirectory": "/resources/database/db1/migrations",
8989
"seedsDirectory": "/resources/database/db1/seeds",
9090
"properties": {
@@ -94,7 +94,7 @@ moduleSettings = {
9494
}
9595
},
9696
"db2": {
97-
"manager": "cfmigrations.models.QBMigrationManager",
97+
"manager": "cbMigrations.models.QBMigrationManager",
9898
"migrationsDirectory": "/resources/database/db2/migrations",
9999
"seedsDirectory": "/resources/database/db2/seeds",
100100
"properties": {
@@ -142,7 +142,7 @@ component {
142142
}
143143
```
144144

145-
Migration files need to follow a specific naming convention — `YYYY_MM_DD_HHMISS_[describe_your_changes_here].cfc`. This is how `cfmigrations` knows in what order to run your migrations. Generating these files is made easier with the `migrate create` command from `commandbox-migrations`.
145+
Migration files need to follow a specific naming convention — `YYYY_MM_DD_HHMISS_[describe_your_changes_here].cfc`. This is how `cbMigrations` knows in what order to run your migrations. Generating these files is made easier with the `migrate create` command from `commandbox-migrations`.
146146

147147
Using the injected `qb` instance, you can insert or update required data for your application. If you want to create test data for your application, take a look at seeders below instead.
148148

@@ -152,7 +152,7 @@ There is no limit to what you can do in a migration. It is recommended that you
152152

153153
There are a few methods for working with migrations. (Each of these methods has a related command in `commandbox-migrations`.)
154154

155-
These methods can be run by injecting `MigrationService@cfmigrations` - for example: `getInstance( "MigrationService@cfmigrations" ).runAllMigrations( "up" )` will run all migrations.
155+
These methods can be run by injecting `MigrationService@cbMigrations` - for example: `getInstance( "MigrationService@cbMigrations" ).runAllMigrations( "up" )` will run all migrations.
156156

157157
#### `runNextMigration`
158158

@@ -236,7 +236,7 @@ component {
236236

237237
#### Setting Schema
238238

239-
It's important to set the `schema` attribute for `cfmigrations`. Without it, `cfmigrations` can't tell the difference
239+
It's important to set the `schema` attribute for `cbMigrations`. Without it, `cbMigrations` can't tell the difference
240240
between a migration table installed in the schema you want and any other schema on the same database. You can
241241
set the schema by calling the `setSchema( string schema )` method.
242242

box.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"name":"CFMigrations",
2+
"name":"cbMigrations",
33
"version":"5.1.1",
44
"location":"forgeboxStorage",
55
"author":"Eric Peterson",
6-
"homepage":"https://github.com/coldbox-modules/cfmigrations",
7-
"documentation":"https://github.com/coldbox-modules/cfmigrations",
6+
"homepage":"https://github.com/coldbox-modules/cbMigrations",
7+
"documentation":"https://github.com/coldbox-modules/cbMigrations",
88
"repository":{
99
"type":"git",
10-
"url":"https://github.com/coldbox-modules/cfmigrations"
10+
"url":"https://github.com/coldbox-modules/cbMigrations"
1111
},
12-
"bugs":"https://github.com/coldbox-modules/cfmigrations/issues",
13-
"slug":"cfmigrations",
12+
"bugs":"https://github.com/coldbox-modules/cbMigrations/issues",
13+
"slug":"cbMigrations",
1414
"shortDescription":"Keep track and run your database migrations with CFML",
15-
"instructions":"https://github.com/coldbox-modules/cfmigrations",
15+
"instructions":"https://github.com/coldbox-modules/cbMigrations",
1616
"type":"modules",
1717
"keywords":[
1818
"server",
@@ -29,7 +29,7 @@
2929
"license":[
3030
{
3131
"type":"MIT",
32-
"URL":"https://github.com/coldbox-modules/cfmigrations/blob/master/LICENSE"
32+
"URL":"https://github.com/coldbox-modules/cbMigrations/blob/master/LICENSE"
3333
}
3434
],
3535
"dependencies":{

dsl/MigrationServiceDSL.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ component {
2424
* @return MigrationService
2525
*/
2626
public MigrationService function process( required struct definition ) {
27-
var settings = variables.injector.getInstance( dsl = "coldbox:moduleSettings:cfmigrations" );
27+
var settings = variables.injector.getInstance( dsl = "coldbox:moduleSettings:cbMigrations" );
2828
return variables.injector.getInstance(
29-
name = "MigrationService@cfmigrations",
29+
name = "MigrationService@cbMigrations",
3030
initArguments = settings.managers[ listRest( arguments.definition.dsl, ":" ) ]
3131
);
3232
}

models/MigrationService.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ component accessors="true" {
33
property name="wirebox" inject="wirebox";
44
property name="configSettings" inject="box:configSettings";
55
property name="environment" default="development";
6-
property name="manager" default="cfmigrations.models.QBMigrationManager";
6+
property name="manager" default="cbMigrations.models.QBMigrationManager";
77
property name="migrationsDirectory" default="resources/database/migrations/";
88
property name="seedsDirectory" default="resources/database/seeds/";
99
property name="seedEnvironments" default="development";
@@ -20,7 +20,7 @@ component accessors="true" {
2020
* @properties
2121
*/
2222
MigrationService function init(
23-
any manager = "cfmigrations.models.QBMigrationManager",
23+
any manager = "cbMigrations.models.QBMigrationManager",
2424
string migrationsDirectory = "/resources/database/migrations",
2525
string seedsDirectory = "/resources/database/seeds",
2626
any seedEnvironments = [ "development" ],

models/QBMigrationManager.cfc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ component accessors="true" {
44
property name="mockData" inject="MockData@cbMockData";
55
property name="defaultGrammar" default="AutoDiscover@qb";
66
property name="datasource";
7-
property name="migrationsTable" default="cfmigrations";
7+
property name="migrationsTable" default="cbmigrations";
88
property name="schema" default="";
99
property name="useTransactions" default="true";
1010

@@ -31,6 +31,13 @@ component accessors="true" {
3131

3232
var schema = newSchemaBuilder();
3333

34+
// v6 renamed the default migrations table from `cfmigrations` to `cbmigrations`.
35+
// Carry forward existing migration history instead of starting fresh.
36+
if ( schema.hasTable( "cfmigrations", getSchema(), { datasource: getDatasource() } ) ) {
37+
schema.rename( "cfmigrations", getMigrationsTable(), { datasource: getDatasource() } );
38+
return;
39+
}
40+
3441
schema.create(
3542
getMigrationsTable(),
3643
function( table ) {

0 commit comments

Comments
 (0)