Fix exception on inserting approvals with no date
For approvals with zero values there is no grant date set in the REST
response when querying the approvals. Trying to insert a patch set
approval with no grant date fails with the following exception:
Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "GRANTED"; SQL statement:
INSERT INTO patch_set_approvals(value,granted,change_id,patch_set_id,account_id,category_id)VALUES(?,?,?,?,?,?) [23502-174]
...
Just take the current timestamp if the grant date is missing.
Approvals with zero values are used to mark reviewers on changes that
haven't voted yet, hence the grant date doesn't matter in this case.
Change-Id: I19fa3f56ac097aef249580aa21be055ea3fb9b77
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
1 file changed