[BUGFIX] Wrong building of relations to system categories

The task that migrates the DAM category relations makes two critical
mistakes:

* the uid_local and uid_foreign fields are inverted (sys_category
  is local, sys_file is foreign)
* the table with the categories relation is sys_file_metadata
  and not sys_file anymore.