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

[tools] 2019 06 10 fix data dict builder #4823

Merged
Merged
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
21 changes: 12 additions & 9 deletions tools/exporters/data_dictionary_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,22 @@
"Name"
);

// Single query to clear all old parameter_type data associated to instruments.
// 2 query to clear all old parameter_type data associated to instruments.
// This data will be rebuilt below and IDs will be preserved when possible using
// the data queried above
// the data queried above. Note, a single multi-join query fail with MySQL 5.7
$DB->run(
"DELETE parameter_type,
parameter_type_category_rel,
parameter_type_category
FROM parameter_type_category
JOIN parameter_type_category_rel USING(ParameterTypeCategoryID)
JOIN parameter_type USING(ParameterTypeID)
WHERE parameter_type_category.Type='Instrument';"
"DELETE parameter_type, parameter_type_category_rel
FROM parameter_type
JOIN parameter_type_category_rel USING (ParameterTypeID)
WHERE ParameterTypeCategoryID IN (
SELECT ParameterTypeCategoryID
FROM parameter_type_category
WHERE Type = 'Instrument'
);"
);

$DB->delete("parameter_type_category", array("Type" => "Instrument"));

print "Cleared data from BVL instruments\n";

print "Reading instruments\n";
Expand Down