Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
Platform 2.4.0
-
None
Description
There seems to be a bug in the liquibase-update-to-2.1.xml script, specifically in the way changeSets "201609171146-3" and "201610242135-3" are implemented.
Basically, the first changeSet adds a new column to an existing table (cohort_member.start_date) with a not-null constraint.
The second changeset populates this column with a default value (from cohort.date_created).
It would seem that if there is existing data in this table for which a default value needs to be applied, then the first change will fail (and this is what we are seeing in our test environments), as it is adding a not-null column that would inherently start with null values.
This specifically seems to manifest in errors with MySQL 5.7+ in which the SQL Mode does not allow "0" for datetime.
NOTE: One way of solving this ticket is to remove the non-null constraint from this table altogether, as tickets TRUNK-5211 and TRUNK-5331 have made clear should never have been done in the first place. burke / dkayiwa / jbyiringiro / tanderson FYI