Announcement

Collapse
No announcement yet.

How to create unique index in two columns

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create unique index in two columns

    Hi. Same title.

    I tried two cases:
    1. "indexes": {
    "type": "index", // maybe different values???
    "index_name": {
    "columns": ["column_1", "column_2"]
    }
    }
    2."column_1": {
    ...
    "unique": "1_same_value_2"
    },
    "column_2": {
    ...
    "unique": "1_same_value_2"
    },

    Case 1: index type : Normal
    Case 2: Three unique indexes are created:
    - column_1
    - column_2
    - column_1, column_2
    --> seems there was an error???

    Can you help me?

  • #2
    application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json

    no under_score, use camelCase

    Comment


    • #3
      Hi. I saw that using under_score and camelCase are the same results (but I will use camelCase in future)
      However, I want to ask is how to create unique index in two columns.

      Ex: in mysql, indexes in table account is
      IDX_ACCOUNT_ASSIGNED_USER assigned_user_id, deleted Normal

      --> I want index type of (assigned_user_id, deleted) is UNIQUE

      How to do it?


      Comment


      • #4
        Try

        "unique" => true

        Comment


        • #5
          It's not right. My solution is create unique index manual by install script.
          Thank you

          Comment

          Working...
          X