[ChangePassword] Fixed problem with triggers. Last update password date column mandatory to avoid NPE
authorJonathan Bueno <jonathan.bueno@openbravo.com>
Thu, 31 Dec 2015 13:11:16 +0100
changeset 28656 b3a1f248e328
parent 28655 6456577534a0
child 28657 adce3187dfda
[ChangePassword] Fixed problem with triggers. Last update password date column mandatory to avoid NPE
src-db/database/model/tables/AD_USER.xml
src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml
--- a/src-db/database/model/tables/AD_USER.xml	Wed Dec 30 10:48:35 2015 +0100
+++ b/src-db/database/model/tables/AD_USER.xml	Thu Dec 31 13:11:16 2015 +0100
@@ -157,7 +157,7 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
-      <column name="LASTUPDATEPASSWORDDATE" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
+      <column name="LASTUPDATEPASSWORDDATE" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
         <default><![CDATA[SYSDATE]]></default>
         <onCreateDefault/>
       </column>
--- a/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Wed Dec 30 10:48:35 2015 +0100
+++ b/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Thu Dec 31 13:11:16 2015 +0100
@@ -28,7 +28,7 @@
    IF :OLD.password<>:NEW.password THEN
      
    UPDATE ad_user
-   SET lastupdatepassworddate='now()'
+   SET lastupdatepassworddate = now()
    WHERE ad_user_id=:NEW.ad_user_id;
 
    ELSE RETURN NEW; END IF;