Fix foreign key reference counting.

Signed-off-by: Toha <tohenk@yahoo.com>
Column local foreign keys now can be many.

Signed-off-by: Toha <tohenk@yahoo.com>
Add table M2M relation log.

Signed-off-by: Toha <tohenk@yahoo.com>