Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjb committed Aug 6, 2024
1 parent 5f431ed commit 090e737
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions database/migrations/000087_migrate_rule_statuses.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ BEGIN;
-- any rule evaluations which happened before we started dual writing.
--
-- As of the previous migration, any entry in rule_evaluations which has a
-- corresponding entry in evaluation_rule_entities will have a non-null
-- value for the rule_entity_id foreign key. In order to simplify the migration
-- this transaction will start off by populating a temporary table with the IDs
-- of the rule_evaluation rows which we need to migrate.
-- corresponding entry in evaluation_rule_entities will have the `migrated`
-- column set to `TRUE`. In order to simplify the migration this transaction
-- will start off by populating a temporary table with the IDs of the
-- rule_evaluation rows which we need to migrate.
--
-- This table also has an evaluation_status_id which will be populated later.
-- This is needed because remediations and alerts in the evaluation history
Expand Down Expand Up @@ -93,8 +93,6 @@ JOIN evaluation_statuses AS es ON es.id = tmp.evaluation_status_id;

-- Set the migrated column in the rows we migrated from
-- rule_evaluations.
-- Recall that we reused the PK of rule_evaluations as the PK for the new rows
-- in evaluation_rule_profiles, so we can simply set rule_entity_id = id.
UPDATE rule_evaluations
SET migrated = TRUE
WHERE id IN (SELECT rule_evaluation_id FROM temp_migrate_rule_evaluations);
Expand Down

0 comments on commit 090e737

Please sign in to comment.