fix primary_key and etc