Removed deprecation warnings

Removed deprecation warnings: "Calling set_primary_key is deprecated."