I can't create my custom primary key on the target database

0

Both databases are in Aurora MySql

In the source database I've a table with serveral fields and the primary key uses only one column 'id'.

In the target database, I need to change the primary key to use two columns: 'platform' + 'id'.

When launch the migratrion task, the target table is created but the primary key is the same as in the source (only with the 'id' column).

This is the JSON of the rules:

{

"rules": [

{
  "rule-type": "selection",
  "rule-id": "10",
  "rule-name": "10",
  "object-locator": {
    "schema-name": "bbdd_in%",
    "table-name": "str_course_cat%"
  },
  "rule-action": "include",
  "filters": []
},
{
  "rule-type": "transformation",
  "rule-id": "21",
  "rule-name": "21",
  "rule-target": "schema",
  "object-locator": {
    "schema-name": "%",
    "table-name": "%"
  },
  "rule-action": "rename",
  "value": "dw"
},
{
  "rule-type": "transformation",
  "rule-id": "22",
  "rule-name": "22",
  "rule-target": "column",
  "object-locator": {
    "schema-name": "%",
    "table-name": "%"
  },
  "rule-action": "add-column",
  "value": "platform",
  "expression": "$AR_M_SOURCE_SCHEMA",
  "data-type": {
    "type": "string",
    "length": "50",
    "scale": ""
  }
},
{
  "rule-type": "transformation",
  "rule-id": "23",
  "rule-name": "23",
  "rule-target": "table",
  "object-locator": {
    "schema-name": "%",
    "table-name": "%"
  },
  "rule-action": "define-primary-key",
  "primary-key-def": {
    "name": "PRIMARY",
    "origin": "primary-key",
    "columns": [
      "platform",
      "id"
    ]
  }
}

]

}

asked a year ago84 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions