Index on additional fields in many-to-many link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimyy
    Active Community Member
    • Jun 2018
    • 574

    Index on additional fields in many-to-many link

    How to add index on additional field in many-to-many link? For example on field "role" in account-to-contact link?

    I try add Index: true to additionalColumns in link description. Nothing happens.
    Code:
        "links": {
            "accounts": {
                "additionalColumns": {
                    "role": {
                        "index":true
                    }
                }
            },
    ​
    Last edited by dimyy; 08-29-2022, 07:34 AM.
  • yuri
    Member
    • Mar 2014
    • 8695

    #2
    This should work I believe:

    PHP Code:

        
    "links": {
            
    "accounts": {
                
    "additionalColumns": {
                    
    "role": {
                        
    "type""varchar"
                    
    }
                },
                
    "indexes": {
                    
    "role": {
                        
    "columns": ["role"]
                    }
                }
            }
        }
    ​ 
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...