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年前88ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ