diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/dtos/LayoutExecutableUpdateDTO.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/dtos/LayoutExecutableUpdateDTO.java index d79512893a..9ddd23ea36 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/dtos/LayoutExecutableUpdateDTO.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/dtos/LayoutExecutableUpdateDTO.java @@ -26,7 +26,6 @@ public class LayoutExecutableUpdateDTO { @JsonView(Views.Internal.class) Boolean executeOnLoad; - @Deprecated @JsonView(Views.Public.class) RunBehaviourEnum runBehaviour; diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java index 4de0347a1e..337dcb396d 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java @@ -106,7 +106,7 @@ public class ActionCE_DTO implements Identifiable, Executable { * Use runBehaviour instead. */ @Deprecated - @JsonView({Views.Internal.class, FromRequest.class, Git.class}) + @JsonView({Views.Internal.class, FromRequest.class}) Boolean executeOnLoad; @JsonView({Views.Public.class, FromRequest.class, Git.class}) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaMigration.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaMigration.java index 8d72075c6a..a57e4f3b64 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaMigration.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaMigration.java @@ -179,6 +179,18 @@ public class JsonSchemaMigration { baseApplicationId, branchName, migratedJson)); } applicationJson.setServerSchemaVersion(11); + case 11: + // This server version bump has been made to support an autocommit for + // structural changes to the git directory. This change refactors + // source modules from source modules directory to subdirectories named after + // packages of the respective modules. + // I.e., source modules/module1.json -> source modules/package1/module1.json + migrateApplicationJsonMono = migrateApplicationJsonMono.map(migratedJson -> { + MigrationHelperMethods.addRunBehaviourToApplicationJson(migratedJson); + return migratedJson; + }); + + applicationJson.setServerSchemaVersion(12); default: } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java index 14a2735550..1ac86013c9 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java @@ -4,7 +4,7 @@ import org.springframework.stereotype.Component; @Component public class JsonSchemaVersionsFallback { - private static final Integer serverVersion = 11; + private static final Integer serverVersion = 12; public static final Integer clientVersion = 2; public Integer getServerVersion() { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java index c361a99812..a01b4c0ebe 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/MigrationHelperMethods.java @@ -1366,4 +1366,23 @@ public class MigrationHelperMethods { actionDatasource.setDatasourceConfiguration(datasourceConfiguration); } } + + public static void addRunBehaviourToApplicationJson(ApplicationJson applicationJson) { + List actionList = applicationJson.getActionList(); + if (CollectionUtils.isNullOrEmpty(actionList)) { + return; + } + + for (NewAction action : actionList) { + if (action.getUnpublishedAction() != null) { + ActionDTO actionDTO = action.getUnpublishedAction(); + actionDTO.setRunBehaviour(actionDTO.getRunBehaviour()); + } + + if (action.getPublishedAction() != null) { + ActionDTO actionDTO = action.getPublishedAction(); + actionDTO.setRunBehaviour(actionDTO.getRunBehaviour()); + } + } + } }