-
Notifications
You must be signed in to change notification settings - Fork 18
Recover rule by rule recertification #3882
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
base: importer-rework
Are you sure you want to change the base?
Changes from all commits
5f72397
5a36ec6
ef76f86
e8688a9
7cdfadf
201646a
374f33a
3890365
bcb3453
25d820b
26fff94
6b4d750
affc456
fa166f1
b0705b0
1f7fa9e
b0cb492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,4 @@ mutation recertify( | |
| ) { | ||
| affected_rows | ||
| } | ||
| ) { | ||
| affected_rows | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,7 +106,7 @@ BEGIN | |
| b_never_recertified := TRUE; | ||
| SELECT INTO t_rule_created rule_metadata.rule_created | ||
| FROM rule | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid AND rule.dev_id=rule_metadata.dev_id) | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| WHERE rule_id=r_rule.rule_id; | ||
| END IF; | ||
|
|
||
|
|
@@ -141,7 +141,7 @@ BEGIN | |
| i_owner_id AS owner_id | ||
| FROM view_rule_with_owner | ||
| LEFT JOIN rule USING (rule_id) | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid AND rule.dev_id=rule_metadata.dev_id) | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| WHERE view_rule_with_owner.rule_id=r_rule.rule_id AND view_rule_with_owner.owner_id IS NULL; | ||
| ELSE | ||
| INSERT INTO recertification (rule_metadata_id, next_recert_date, rule_id, ip_match, owner_id) | ||
|
|
@@ -152,7 +152,7 @@ BEGIN | |
| i_owner_id AS owner_id | ||
| FROM view_rule_with_owner | ||
| LEFT JOIN rule USING (rule_id) | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid AND rule.dev_id=rule_metadata.dev_id) | ||
| LEFT JOIN rule_metadata ON (rule.rule_uid=rule_metadata.rule_uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| WHERE view_rule_with_owner.rule_id=r_rule.rule_id AND view_rule_with_owner.owner_id=i_owner_id; | ||
| END IF; | ||
| ELSE | ||
|
|
@@ -226,11 +226,12 @@ BEGIN | |
| SELECT I.start_time::timestamp + make_interval (days => o.recert_interval) AS value | ||
| UNION | ||
| SELECT C.recert_date + make_interval (days => o.recert_interval) AS value | ||
| ) AS temp_table)) | ||
| ) AS temp_table)), | ||
| NULL::bigint AS owner_recert_id | ||
| FROM | ||
| view_rule_with_owner V | ||
| LEFT JOIN rule R USING (rule_id) | ||
| LEFT JOIN rule_metadata M ON (R.rule_uid=M.rule_uid AND R.dev_id=M.dev_id) | ||
| LEFT JOIN rule_metadata M ON (R.rule_uid=M.rule_uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| LEFT JOIN owner O ON (O.id=0) | ||
| LEFT JOIN import_control I ON (R.rule_create=I.control_id) | ||
| LEFT JOIN recertification C ON (M.rule_metadata_id=C.rule_metadata_id) | ||
|
|
@@ -253,11 +254,12 @@ BEGIN | |
| SELECT I.start_time::timestamp + make_interval (days => o.recert_interval) AS value | ||
| UNION | ||
| SELECT C.recert_date + make_interval (days => o.recert_interval) AS value | ||
| ) AS temp_table)) | ||
| ) AS temp_table)), | ||
| NULL::bigint AS owner_recert_id | ||
| FROM | ||
| view_rule_with_owner V | ||
| LEFT JOIN rule R USING (rule_id) | ||
| LEFT JOIN rule_metadata M ON (R.rule_uid=M.rule_uid AND R.dev_id=M.dev_id) | ||
| LEFT JOIN rule_metadata M ON (R.rule_uid=M.rule_uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| LEFT JOIN owner O ON (V.owner_id=O.id) | ||
| LEFT JOIN import_control I ON (R.rule_create=I.control_id) | ||
| LEFT JOIN recertification C ON (M.rule_metadata_id=C.rule_metadata_id) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,9 +41,6 @@ public class RuleMetadata | |
| [JsonProperty("recert_history"), JsonPropertyName("recert_history")] | ||
| public List<Recertification> RecertHistory { get; set; } = []; | ||
|
|
||
| [JsonProperty("dev_id"), JsonPropertyName("dev_id")] | ||
| public int DeviceId { get; set; } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we need to add mgm_id here (when #3885 is merged). |
||
| [JsonProperty("rule_uid"), JsonPropertyName("rule_uid")] | ||
| public string? Uid { get; set; } = ""; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to add mgm_id here (when #3885 is merged).