Tables with no primary keys confused code generators
Merge pull request #504 from K-Phoen/fix-452

Fix #452