Refact

* move info of foreign key from 'extra' in 'key'.
* change fields sequence.