forked from stevenbristol/lovd-by-less
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving time_zone from users to profiles table. Fixing migration down …
…of last_activity_at
- Loading branch information
1 parent
6311417
commit 26961b8
Showing
5 changed files
with
16 additions
and
4 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 |
---|---|---|
|
@@ -4,6 +4,6 @@ def self.up | |
end | ||
|
||
def self.down | ||
remove_column :last_activity_at | ||
remove_column :profiles, :last_activity_at | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class MoveTimezoneToProfiles < ActiveRecord::Migration | ||
def self.up | ||
add_column :profiles, :time_zone, :string, :default => "UTC" | ||
remove_column :users, :time_zone | ||
execute "update profiles set time_zone='UTC'" | ||
end | ||
|
||
def self.down | ||
remove_column :profiles, :time_zone | ||
add_column :users, :time_zone, :string, :default => "UTC" | ||
end | ||
end |