Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bugs in database migration files
Signed-off-by: Ramón Martínez Olvera <martinezo@udevelopper-viii.(none)>
- Loading branch information
Deployer Unidad de Computo INB
authored and
Ramón Martínez Olvera
committed
Feb 22, 2012
1 parent
0db18fd
commit a58e6e1
Showing
6 changed files
with
40 additions
and
2 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
7 changes: 6 additions & 1 deletion
7
db/migrate/20101202022616_rename_user_stimuluses_to_user_stimuli.rb
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
14 changes: 14 additions & 0 deletions
14
db/migrate/20101209194041_normalize_duplicated_id_in_people.rb
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,14 @@ | ||
class NormalizeDuplicatedIdInPeople < ActiveRecord::Migration | ||
|
||
def self.up | ||
last_id = Person.unscoped.order("id DESC").first.id | ||
Person.all.each do |record| | ||
last_id += 1 | ||
execute "UPDATE people SET id = #{last_id} WHERE user_id = #{record.user_id}" | ||
end | ||
|
||
end | ||
|
||
def self.down | ||
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
2 changes: 1 addition & 1 deletion
2
db/migrate/20120216225821_remove_trigger_user_status_update_on_users.rb
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