-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: if participant is enrolled as reservist, activity is marked as …
…such
- Loading branch information
1 parent
81a4868
commit ba383c2
Showing
6 changed files
with
46 additions
and
8 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
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
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
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 |
---|---|---|
@@ -1,5 +1,19 @@ | ||
class AddCalendarIdToMember < ActiveRecord::Migration[6.1] | ||
def change | ||
def up | ||
add_column :members, :calendar_id, :uuid | ||
|
||
# Populate existing records with a random UUID | ||
Member.reset_column_information | ||
Member.find_each do |record| | ||
record.update_columns(calendar_id: SecureRandom.uuid) | ||
end | ||
|
||
# Add a unique index to the UUID column, because why not | ||
add_index :members, :calendar_id, unique: true | ||
end | ||
|
||
def down | ||
# Remove the UUID column | ||
remove_column :members, :calendar_id | ||
end | ||
end |
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
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