Moved foreign keys to separate file, to prevent missing references errors. Added entity/edit-related tables.