← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10628: Fix bug for program with disableRegistrationFields as active.

 

------------------------------------------------------------
revno: 10628
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-04-19 10:31:52 +0700
message:
  Fix bug for program with disableRegistrationFields as active.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-04-18 09:21:21 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-04-19 03:31:52 +0000
@@ -211,6 +211,10 @@
         updateProgramInstanceStatus();
         
         executeSql( "UPDATE program SET disableRegistrationFields=false where disableRegistrationFields is null" );
+        executeSql( "ALTER TABLE program ALTER COLUMN dateofincidentdescription DROP NOT NULL");
+        executeSql( "ALTER TABLE patient ALTER COLUMN birthdate DROP NOT NULL");
+        executeSql( "ALTER TABLE patient ALTER COLUMN gender DROP NOT NULL");
+        executeSql( "ALTER TABLE patient ALTER COLUMN underage DROP NOT NULL");
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2012-09-11 07:31:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-04-19 03:31:52 +0000
@@ -16,7 +16,7 @@
 
     <property name="lastName" column="lastname" length="50" />
 
-    <property name="birthDate" column="birthdate" not-null="true" />
+    <property name="birthDate" column="birthdate" />
 
     <property name="deathDate" column="deathdate" />
 
@@ -24,11 +24,11 @@
 
     <property name="isDead" column="isdead" />
 
-    <property name="gender" column="gender" length="5" not-null="true" />
+    <property name="gender" column="gender" length="5" />
 
     <property name="phoneNumber" length="25" />
 
-    <property name="underAge" column="underage" not-null="true" />
+    <property name="underAge" column="underage" />
 
     <property name="dobType" column="dobType" />
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2013-04-18 06:45:36 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2013-04-19 03:31:52 +0000
@@ -21,7 +21,7 @@
 
     <property name="dateOfEnrollmentDescription" type="text" not-null="true" />
 
-    <property name="dateOfIncidentDescription" type="text" not-null="true" />
+    <property name="dateOfIncidentDescription" type="text" />
 
     <set name="programStages" order-by="mindaysfromstart" cascade="all">
       <key column="programid" />