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"
    ]
  }
}

]

}

已提問 1 年前檢視次數 87 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南