diff options
Diffstat (limited to 'db/migrate')
| -rw-r--r-- | db/migrate/20260627233640_upgrade_events_and_nodes_for_standalone_events.rb | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/db/migrate/20260627233640_upgrade_events_and_nodes_for_standalone_events.rb b/db/migrate/20260627233640_upgrade_events_and_nodes_for_standalone_events.rb index 790a62b..2605e5c 100644 --- a/db/migrate/20260627233640_upgrade_events_and_nodes_for_standalone_events.rb +++ b/db/migrate/20260627233640_upgrade_events_and_nodes_for_standalone_events.rb | |||
| @@ -4,10 +4,6 @@ class UpgradeEventsAndNodesForStandaloneEvents < ActiveRecord::Migration[8.1] | |||
| 4 | change_column_null :events, :node_id, true | 4 | change_column_null :events, :node_id, true |
| 5 | add_column :events, :title, :string | 5 | add_column :events, :title, :string |
| 6 | add_column :events, :description, :text | 6 | add_column :events, :description, :text |
| 7 | add_column :events, :is_primary, :boolean, default: false, null: false | ||
| 8 | |||
| 9 | # Mark all existing events as primary (they were all 1:1 with nodes) | ||
| 10 | Event.where.not(node_id: nil).update_all(is_primary: true) | ||
| 11 | 7 | ||
| 12 | # Occurrences: make node optional | 8 | # Occurrences: make node optional |
| 13 | change_column_null :occurrences, :node_id, true | 9 | change_column_null :occurrences, :node_id, true |
| @@ -19,7 +15,6 @@ class UpgradeEventsAndNodesForStandaloneEvents < ActiveRecord::Migration[8.1] | |||
| 19 | def down | 15 | def down |
| 20 | remove_column :nodes, :external_url | 16 | remove_column :nodes, :external_url |
| 21 | change_column_null :occurrences, :node_id, false | 17 | change_column_null :occurrences, :node_id, false |
| 22 | remove_column :events, :is_primary | ||
| 23 | remove_column :events, :description | 18 | remove_column :events, :description |
| 24 | remove_column :events, :title | 19 | remove_column :events, :title |
| 25 | change_column_null :events, :node_id, false | 20 | change_column_null :events, :node_id, false |
