Revert "Updated migration to clear some extra foreign keys"

This reverts commit 8d3f935a1104201df4e2ede2ed8d4ebf92ca9091.
Revert "Remove activity log tables and rename marketplace's (bug 1004786)"

This reverts commit 489205f6019b3c5a646ba5a9e1ea23dc2b8b3300.