-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1527 from eiffel777/update-raw-stats-correct-time…
…-field Updates for cloud Data Export and migration pipelines.
- Loading branch information
Showing
9 changed files
with
70 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"#": "This action loads data from a structured file and only needs the table definition", | ||
"table_definition": [ | ||
{ | ||
"$ref": "${table_definition_dir}/cloud_common/host.json#/table_definition" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
["resource_id", "host_id", "hostname"], | ||
[-1, 1, "Unknown"] | ||
] |
25 changes: 25 additions & 0 deletions
25
configuration/etl/etl_sql.d/migrations/9.0.0-9.5.0/modw_cloud/update_hosts_table_index.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
LOCK TABLES | ||
modw_cloud.host WRITE, | ||
modw_cloud.host as h WRITE, | ||
modw_cloud.event WRITE, | ||
modw_cloud.event as ev WRITE; | ||
|
||
ALTER TABLE modw_cloud.host MODIFY host_id INT NOT NULL; | ||
ALTER TABLE modw_cloud.host DROP INDEX autoincrement_key; | ||
ALTER TABLE modw_cloud.host ADD COLUMN new_host_id INT(11) UNSIGNED NOT NULL auto_increment unique; | ||
CREATE INDEX host_resource_idx ON modw_cloud.host (host_id, resource_id); | ||
|
||
UPDATE | ||
modw_cloud.event as ev | ||
JOIN | ||
modw_cloud.host as h | ||
ON | ||
ev.resource_id = h.resource_id AND ev.host_id = h.host_id | ||
SET | ||
ev.host_id = h.new_host_id; | ||
|
||
ALTER TABLE modw_cloud.host DROP COLUMN host_id; | ||
ALTER TABLE modw_cloud.host CHANGE new_host_id host_id INT(11) UNSIGNED; | ||
DROP INDEX host_resource_idx ON modw_cloud.host; | ||
|
||
UNLOCK TABLES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters