Skip to content

Commit 68c70de

Browse files
committed
Merge branch 'develop' of https://github.com/cfwheels/cfwheels into develop
2 parents 5780814 + 70efe13 commit 68c70de

File tree

9 files changed

+39
-6
lines changed

9 files changed

+39
-6
lines changed

compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
context: ./
1414
dockerfile: ./docker/lucee@5/Dockerfile
1515
image: cfwheels-test-lucee5:v1.0.2
16+
restart: always
1617
volumes:
1718
- ./:/cfwheels-test-suite
1819
- ~/.CommandBox/artifacts:/root/.CommandBox/artifacts
@@ -30,6 +31,7 @@ services:
3031
context: ./
3132
dockerfile: ./docker/lucee@6/Dockerfile
3233
image: cfwheels-test-lucee6:v1.0.2
34+
restart: always
3335
volumes:
3436
- ./:/cfwheels-test-suite
3537
- ~/.CommandBox/artifacts:/root/.CommandBox/artifacts
@@ -47,6 +49,7 @@ services:
4749
context: ./
4850
dockerfile: ./docker/adobe@2018/Dockerfile
4951
image: cfwheels-test-adobe2018:v1.0.2
52+
restart: always
5053
volumes:
5154
- ./:/cfwheels-test-suite
5255
- ~/.CommandBox/artifacts:/root/.CommandBox/artifacts
@@ -64,6 +67,7 @@ services:
6467
context: ./
6568
dockerfile: ./docker/adobe@2021/Dockerfile
6669
image: cfwheels-test-adobe2021:v1.0.2
70+
restart: always
6771
volumes:
6872
- ./:/cfwheels-test-suite
6973
- ~/.CommandBox/artifacts:/root/.CommandBox/artifacts
@@ -81,6 +85,7 @@ services:
8185
context: ./
8286
dockerfile: ./docker/adobe@2023/Dockerfile
8387
image: cfwheels-test-adobe2023:v1.0.1
88+
restart: always
8489
volumes:
8590
- ./:/cfwheels-test-suite
8691
- ~/.CommandBox/artifacts:/root/.CommandBox/artifacts

docker/adobe@2018/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV HEALTHCHECK_URI "http://127.0.0.1:62018/"
88
ENV ENV_MODE "remote"
99
ENV BOX_SERVER_CFCONFIGFILE "/cfwheels-test-suite/docker/adobe@2018/CFConfig.json"
1010
ENV BOX_SERVER_PROFILE "none"
11+
ENV BOX_INSTALL TRUE
1112

1213
# WARM UP THE SERVER
1314
RUN ${BUILD_DIR}/util/warmup-server.sh

docker/adobe@2021/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV HEALTHCHECK_URI "http://127.0.0.1:62021/"
88
ENV ENV_MODE "remote"
99
ENV BOX_SERVER_CFCONFIGFILE "./docker/adobe@2021/CFConfig.json"
1010
ENV BOX_SERVER_PROFILE "none"
11+
ENV BOX_INSTALL TRUE
1112

1213
# WARM UP THE SERVER
1314
RUN ${BUILD_DIR}/util/warmup-server.sh

docker/adobe@2023/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV HEALTHCHECK_URI "http://127.0.0.1:62023/"
88
ENV ENV_MODE "remote"
99
ENV BOX_SERVER_CFCONFIGFILE "./docker/adobe@2023/CFConfig.json"
1010
ENV BOX_SERVER_PROFILE "none"
11+
ENV BOX_INSTALL TRUE
1112

1213
# WARM UP THE SERVER
1314
RUN ${BUILD_DIR}/util/warmup-server.sh

docker/lucee@5/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ENV HEALTHCHECK_URI "http://127.0.0.1:60005/"
1111
ENV ENV_MODE "remote"
1212
ENV BOX_SERVER_CFCONFIGFILE "/cfwheels-test-suite/docker/lucee@5/CFConfig.json"
1313
ENV BOX_SERVER_PROFILE "none"
14+
ENV BOX_INSTALL TRUE
1415

1516
# WARM UP THE SERVER
16-
RUN ${BUILD_DIR}/util/warmup-server.sh
17+
RUN ${BUILD_DIR}/util/warmup-server.sh

docker/lucee@6/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ENV HEALTHCHECK_URI "http://127.0.0.1:60006/"
1111
ENV ENV_MODE "remote"
1212
ENV BOX_SERVER_CFCONFIGFILE "/cfwheels-test-suite/docker/lucee@6/CFConfig.json"
1313
ENV BOX_SERVER_PROFILE "none"
14+
ENV BOX_INSTALL TRUE
1415

1516
# WARM UP THE SERVER
1617
RUN ${BUILD_DIR}/util/warmup-server.sh

vendor/wheels/Migrator.cfc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ component output="false" extends="wheels.Global"{
2222
* [category: General Functions]
2323
*
2424
* @version The Database schema version to migrate to
25+
* @missingMigFlag Flag for any available missing migrations
2526
*/
26-
public string function migrateTo(string version = "") {
27+
public string function migrateTo(string version = "", boolean missingMigFlag) {
2728
local.rv = "";
2829
local.currentVersion = getCurrentMigrationVersion();
2930
local.appKey = $appKey();
@@ -34,7 +35,7 @@ component output="false" extends="wheels.Global"{
3435
DirectoryCreate(this.paths.sql);
3536
}
3637
local.migrations = getAvailableMigrations();
37-
if (local.currentVersion > arguments.version) {
38+
if (local.currentVersion > arguments.version && arguments.missingMigFlag == false) {
3839
local.rv = "Migrating from #local.currentVersion# down to #arguments.version#.#Chr(13)#";
3940
for (local.i = ArrayLen(local.migrations); local.i >= 1; local.i--) {
4041
local.migration = local.migrations[local.i];
@@ -63,7 +64,12 @@ component output="false" extends="wheels.Global"{
6364
}
6465
}
6566
} else {
66-
local.rv = "Migrating from #local.currentVersion# up to #arguments.version#.#Chr(13)#";
67+
if(arguments.missingMigFlag){
68+
local.rv = "Migrating remaining migrations till #arguments.version#.#Chr(13)#";
69+
$removeVersionAsMigrated(local.currentVersion);
70+
} else {
71+
local.rv = "Migrating from #local.currentVersion# up to #arguments.version#.#Chr(13)#";
72+
}
6773
for (local.migration in local.migrations) {
6874
if (local.migration.version <= arguments.version && local.migration.status != "migrated") {
6975
transaction {
@@ -88,6 +94,9 @@ component output="false" extends="wheels.Global"{
8894
break;
8995
}
9096
};
97+
if(arguments.missingMigFlag){
98+
$setVersionAsMigrated(local.currentVersion);
99+
}
91100
}
92101
}
93102
return local.rv;

vendor/wheels/public/migrator/command.cfm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ param name="request.wheels.params.command";
33
param name="request.wheels.params.version";
44
55
executeAction = StructKeyExists(request.wheels.params, "confirm") && request.wheels.params.confirm ? true : false;
6+
missingMigFlag = StructKeyExists(request.wheels.params, "missingMigFlag") && request.wheels.params.missingMigFlag ? true : false;
7+
68
message = "";
79
result = "";
810
@@ -12,7 +14,7 @@ if (executeAction) {
1214
migrator = application.wheels.migrator;
1315
switch (request.wheels.params.command) {
1416
case "migrateTo":
15-
result = migrator.migrateTo(request.wheels.params.version);
17+
result = migrator.migrateTo(request.wheels.params.version, missingMigFlag);
1618
break;
1719
case "migrateTolatest":
1820
result = migrator.migrateToLatest();
@@ -45,7 +47,7 @@ if (executeAction) {
4547
<div id="result" class="scrolling content longer">
4648
<cfif !executeAction>
4749
<div class="ui red message">Confirmation Required: #message#</div>
48-
<div class="ui red button execute" data-data-url="#urlFor(route='wheelsMigratorCommand', command=request.wheels.params.command, version=request.wheels.params.version, params="confirm=1")#">Execute</div>
50+
<div class="ui red button execute" data-data-url="#urlFor(route='wheelsMigratorCommand', command=request.wheels.params.command, version=request.wheels.params.version, params="confirm=1&missingMigFlag=#missingMigFlag#")#">Execute</div>
4951
<cfelse>
5052
<pre><code class="sql" style="overflow-y: scroll; height:500px;">#result#</code></pre>
5153
</cfif>

vendor/wheels/public/views/migrator.cfm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ try {
1010
datasourceAvailable = false;
1111
message = err.message;
1212
}
13+
// Get any remaining Missing Migrations
14+
if(currentVersion == latestVersion){
15+
local.remainingMigrations = [];
16+
for(local.migration in availableMigrations){
17+
if(local.migration.status != "migrated") arrayAppend(local.remainingMigrations, local.migration);
18+
}
19+
}
1320
</cfscript>
1421
<!--- cfformat-ignore-start --->
1522
<cfoutput>
@@ -26,8 +33,13 @@ try {
2633
latestClass = currentVersion EQ latestVersion ? "disabled" : "performmigration";
2734
resetClass = currentVersion EQ 0 ? "disabled" : "performmigration";
2835
</cfscript>
36+
<cfif structKeyExists(local, "remainingMigrations") && arrayLen(local.remainingMigrations)>
37+
<div class="ui button violet performmigration"
38+
data-data-url="#urlFor(route='wheelsMigratorCommand', command="migrateto", version='#local.remainingMigrations[1]["version"]#', params="missingMigFlag=1")#">Migrate Missing Migrations</div>
39+
<cfelse>
2940
<div class="ui button violet #latestClass#"
3041
data-data-url="#urlFor(route='wheelsMigratorCommand', command="migrateto", version='#latestVersion#')#">Migrate To Latest</div>
42+
</cfif>
3143

3244
<div class="ui button red #resetClass#"
3345
data-data-url="#urlFor(route='wheelsMigratorCommand', command="migrateto", version=0)#">Reset Database</div>

0 commit comments

Comments
 (0)