fixes to db constraints per review comments
fixes to db constraints per review comments


Former-commit-id: 1fdeceaef1728ed2ca793c3bd4f25de665a1b924 [formerly 1fdeceaef1728ed2ca793c3bd4f25de665a1b924 [formerly 620ca625a6d1450e8143e9fba8cb7078daa61ae3]]
Former-commit-id: 85d7efe4b30c8abde20a3f066250fc64044360b9
Former-commit-id: 87a9028a0af09d220ff1a15604fb20133aa9121a
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine