Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change order columns in autoincrement keys for cloud tables #861

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/OpenXdmod/Shredder/aCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function shredDirectory($directory)
return false;
}

Utilities::runEtlPipeline(array('jobs-common','jobs-cloud-common','ingest-organizations', 'ingest-resource-types', 'ingest-resources'), $this->logger);
Utilities::runEtlPipeline(array('jobs-common', 'ingest-organizations', 'ingest-resource-types', 'ingest-resources', 'jobs-cloud-common'), $this->logger);
Utilities::runEtlPipeline(
$this->etlPipelines,
$this->logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"source_query": {
"records": {
"resource_id": "rf.id",
"unknown_id": -1,
"unknown_id": 1,
"unknown_key": "'unknown'",
"unknown_display": "'Unknown'"
},
Expand Down
9 changes: 3 additions & 6 deletions configuration/etl/etl_tables.d/cloud_common/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"#": "is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is",
"#": "useful when you want to put data into ordered groups.",
"#": "See [MyISAM Notes](https://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html)",
"#": "and https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",

"indexes": [
{
Expand All @@ -52,14 +53,10 @@
"is_unique": true
},
{
"#": "The ordering of autoincrement id + resource_id is explicit and mandatory.",
"#": "This is because MyISAM mandates that composite keys containing an",
"#": "autoincrement value have said value as the first key.",
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "autoincrement_key",
"columns": [
"account_id",
"resource_id"
"resource_id",
"account_id"
],
"is_unique": true
},
Expand Down
4 changes: 2 additions & 2 deletions configuration/etl/etl_tables.d/cloud_common/asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@

"name": "autoincrement_key",
"columns": [
"asset_id",
"resource_id"
"resource_id",
"asset_id"
],
"is_unique": true
}
Expand Down
4 changes: 2 additions & 2 deletions configuration/etl/etl_tables.d/cloud_common/avail_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "autoincrement_key",
"columns": [
"avail_zone_id",
"resource_id"
"resource_id",
"avail_zone_id"
],
"is_unique": true
}
Expand Down
10 changes: 3 additions & 7 deletions configuration/etl/etl_tables.d/cloud_common/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@
"#": "is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is",
"#": "useful when you want to put data into ordered groups.",
"#": "See [MyISAM Notes](https://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html)",

"#": "The ordering of autoincrement id + resource_id is explicit and mandatory.",
"#": "This is because MyISAM mandates that composite keys containing an",
"#": "autoincrement value have said value as the first key.",
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"#": "and https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "autoincrement_key",
"columns": [
"host_id",
"resource_id"
"resource_id",
"host_id"
],
"is_unique": true
}
Expand Down
10 changes: 3 additions & 7 deletions configuration/etl/etl_tables.d/cloud_common/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@
"#": "is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is",
"#": "useful when you want to put data into ordered groups.",
"#": "See [MyISAM Notes](https://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html)",

"#": "The ordering of autoincrement id + resource_id is explicit and mandatory.",
"#": "This is because MyISAM mandates that composite keys containing an",
"#": "autoincrement value have said value as the first key.",
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"#": "https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "autoincrement_key",
"columns": [
"image_id",
"resource_id"
"resource_id",
"image_id"
],
"is_unique": true
}
Expand Down
10 changes: 3 additions & 7 deletions configuration/etl/etl_tables.d/cloud_common/instance.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,11 @@
"#": "is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is",
"#": "useful when you want to put data into ordered groups.",
"#": "See [MyISAM Notes](https://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html)",

"#": "The ordering of autoincrement id + resource_id is explicit and mandatory.",
"#": "This is because MyISAM mandates that composite keys containing an",
"#": "autoincrement value have said value as the first key.",
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"#": "https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "increment_key",
"columns": [
"instance_id",
"resource_id"
"resource_id",
"instance_id"
],
"is_unique": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@

"name": "increment_key",
"columns": [
"instance_type_id",
"resource_id"
"resource_id",
"instance_type_id"
],
"is_unique": true
}
Expand Down
10 changes: 3 additions & 7 deletions configuration/etl/etl_tables.d/cloud_common/region.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,11 @@
"#": "is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is",
"#": "useful when you want to put data into ordered groups.",
"#": "See [MyISAM Notes](https://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html)",

"#": "The ordering of autoincrement id + resource_id is explicit and mandatory.",
"#": "This is because MyISAM mandates that composite keys containing an",
"#": "autoincrement value have said value as the first key.",
"#": "See the following for details: https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"#": "https://www.ryadel.com/en/mysql-two-columns-primary-key-with-auto-increment/",
"name": "autoincrement_key",
"columns": [
"region_id",
"resource_id"
"resource_id",
"region_id"
],
"is_unique": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ public function provideFilterIdLookup()
'realm' => 'Cloud',
'filters' => array(
array(
array('project' => '2'),
array('project_filter' => '2'),
array('project' => '3'),
array('project_filter' => '3'),
array('project_filter'=> '"zealous"')
)
),
Expand Down Expand Up @@ -656,7 +656,7 @@ public function provideFilterIdLookup()
'realm' => 'Cloud',
'filters' => array(
array(
array('project_filter' => '1,2,3'),
array('project_filter' => '2,3,4'),
array('project_filter'=> '\'zealous\',\'youthful\',\'zen\'')
)
),
Expand Down