CMS-2176 org.postgresql.util.PSQLException: ERROR: null value in column "sctf_lkey" violates not-null constraint

refactored according to requirements.
Merge pull request #108 from enonic/CMS-2176-3

CMS-2176 org.postgresql.util.PSQLException: ERROR: null value in column "sctf_lkey" violates not-null constraint