Add indexes and primary keys.
Revert "Add indexes and primary keys."

This reverts commit 3b33712dc9f4a3debfb98bc892034d7e41804a17.
Add indexes and primary keys.
Merge pull request #2433 from owncloud/db_primary_keys

Additional indexes and missing primary keys