Fix depreciation warning: Calling set_primary_key is deprecated. Please use  instead.