Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class BackfillUseForProjectionsFromConcealment < ActiveRecord::Migration[8.1]
# Per #2229: use_for_projections replaces the concealment predicate in the
# projection engine's event selection. Seed it from the current behavior
# (concealed event groups are excluded) so the flag's introduction is
# invisible at rollout; after this, the two move independently.
def up
updated = execute(<<~SQL.squish)
update events
set use_for_projections = false
from event_groups
where event_groups.id = events.event_group_id
and event_groups.concealed is true
SQL
say "Set use_for_projections = false on #{updated.cmd_tuples} events in concealed event groups"
end

def down
# No-op. The flag decouples from concealment going forward, so there is
# no prior state to restore beyond the column default.
end
end
2 changes: 1 addition & 1 deletion db/data_schema.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DataMigrate::Data.define(version: 2026_05_09_033127)
DataMigrate::Data.define(version: 2026_08_20_162538)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddUseForProjectionsToEvents < ActiveRecord::Migration[8.1]
def change
add_column :events, :use_for_projections, :boolean, default: true, null: false
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.1].define(version: 2026_07_29_185523) do
ActiveRecord::Schema[8.1].define(version: 2026_08_20_162536) do
# These are extensions that must be enabled in order to support this database
enable_extension "fuzzystrmatch"
enable_extension "pg_catalog.plpgsql"
Expand Down Expand Up @@ -308,6 +308,7 @@
t.string "slug", null: false
t.string "topic_resource_key"
t.datetime "updated_at", precision: nil, null: false
t.boolean "use_for_projections", default: true, null: false
t.index ["course_id"], name: "index_events_on_course_id"
t.index ["event_group_id", "short_name"], name: "index_events_on_event_group_id_and_short_name", unique: true
t.index ["event_group_id"], name: "index_events_on_event_group_id"
Expand Down
1 change: 1 addition & 0 deletions erd.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ erDiagram
string short_name
string slug
string topic_resource_key
boolean use_for_projections
}
EventGroup {
boolean available_live
Expand Down