* Refs #5671 : Fix table type and foreign keys
* Refs #5671 : Better unittest
* Refs #5761 : Fix foreign keys