Migration on a deployment failed because it was done using a portfolio artifact which contained only a partial "in_motion" migration. The part it didn't contain needs to be moved into its own migration script.
diff --git a/service/src/main/resources/db/migrations/mariadb/V2__in_motion.sql b/service/src/main/resources/db/migrations/mariadb/V2__in_motion.sql
index 0bcfebc..cafde63 100644
--- a/service/src/main/resources/db/migrations/mariadb/V2__in_motion.sql
+++ b/service/src/main/resources/db/migrations/mariadb/V2__in_motion.sql
@@ -16,6 +16,4 @@
 
 # noinspection SqlNoDataSourceInspectionForFile
 
-ALTER TABLE bastet_p_chrg_defs ADD COLUMN proportional_to VARCHAR(32) NULL DEFAULT NULL;
-
-ALTER TABLE bastet_cases ADD COLUMN end_of_term TIMESTAMP(3) NULL DEFAULT NULL;
\ No newline at end of file
+ALTER TABLE bastet_p_chrg_defs ADD COLUMN proportional_to VARCHAR(32) NULL DEFAULT NULL;
\ No newline at end of file
diff --git a/service/src/main/resources/db/migrations/mariadb/V4__fixing_in_motion_migration.sql b/service/src/main/resources/db/migrations/mariadb/V4__fixing_in_motion_migration.sql
new file mode 100644
index 0000000..648ef48
--- /dev/null
+++ b/service/src/main/resources/db/migrations/mariadb/V4__fixing_in_motion_migration.sql
@@ -0,0 +1,17 @@
+--
+-- Copyright 2017 The Mifos Initiative.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+--    http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+ALTER TABLE bastet_cases ADD COLUMN end_of_term TIMESTAMP(3) NULL DEFAULT NULL;
\ No newline at end of file