-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c3a05e
commit a74022f
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2021, Pfadibewegung Schweiz. This file is part of | ||
# hitobito_pbs and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_pbs. | ||
|
||
class MergeBsvAndTrainingDays < ActiveRecord::Migration[6.0] | ||
def up | ||
rename_column:event_participations, :bsv_days, :training_days | ||
Event.update_all "training_days = bsv_days" | ||
remove_column :events, :bsv_days | ||
end | ||
|
||
def down | ||
rename_column:event_participations, :training_days, :bsv_days | ||
add_column :events, :bsv_days, :decimal, scale: 2, precision: 6 | ||
Event.update_all "bsv_days = training_days" | ||
end | ||
end |