]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20110508145337_cleanup_bug_tables.rb
Merge branch 'master' into openstreetbugs
[rails.git] / db / migrate / 20110508145337_cleanup_bug_tables.rb
1 class CleanupBugTables < ActiveRecord::Migration
2   def self.up
3     rename_column :map_bugs, :date_created, :created_at
4     rename_column :map_bugs, :last_changed, :updated_at
5     rename_column :map_bugs, :date_closed, :closed_at
6
7     rename_index :map_bugs, :map_bugs_tile_idx, :map_bugs_tile_staus_idx
8     rename_index :map_bugs, :map_bugs_changed_idx, :map_bugs_updated_at_idx
9     rename_index :map_bugs, :map_bugs_created_idx, :map_bugs_created_at_idx
10
11     rename_column :map_bug_comment, :date_created, :created_at
12     rename_column :map_bug_comment, :commenter_name, :author_name
13     rename_column :map_bug_comment, :commenter_ip, :author_ip
14     rename_column :map_bug_comment, :commenter_id, :author_id
15     rename_column :map_bug_comment, :comment, :body
16
17     rename_index :map_bug_comment, :map_bug_comment_id_idx, :map_bug_comment_bug_id_idx
18   end
19
20   def self.down
21     rename_index :map_bug_comment, :map_bug_comment_bug_id_idx, :map_bug_comment_id_idx
22
23     rename_column :map_bug_comment, :body, :comment
24     rename_column :map_bug_comment, :author_id, :commenter_id
25     rename_column :map_bug_comment, :author_ip, :commenter_ip
26     rename_column :map_bug_comment, :author_name, :commenter_name
27     rename_column :map_bug_comment, :created_at, :date_created
28
29     rename_index :map_bugs, :map_bugs_created_at_idx, :map_bugs_created_idx
30     rename_index :map_bugs, :map_bugs_updated_at_idx, :map_bugs_changed_idx
31     rename_index :map_bugs, :map_bugs_tile_staus_idx, :map_bugs_tile_idx
32
33     rename_column :map_bugs, :closed_at, :date_closed
34     rename_column :map_bugs, :updated_at, :last_changed
35     rename_column :map_bugs, :created_at, :date_created
36   end
37 end