diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/065_add_comments_to_user_track.rb | 14 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/db/migrate/065_add_comments_to_user_track.rb b/db/migrate/065_add_comments_to_user_track.rb new file mode 100644 index 000000000..9c4ff2936 --- /dev/null +++ b/db/migrate/065_add_comments_to_user_track.rb @@ -0,0 +1,14 @@ +class AddCommentsToUserTrack < ActiveRecord::Migration + def self.up + TrackThing.update_all "track_query = replace(track_query, 'variety:sent ', '') where track_type in ('public_body_updates', 'user_updates')" + track_things = TrackThing.find(:all, :conditions => [ "track_type = 'user_updates'" ]) + for track_thing in track_things + track_thing.track_query = track_thing.track_query.gsub(/^requested_by:([^\s]+)$/, "requested_by:\\1 OR commented_by:\\1") + track_thing.save! + end + end + + def self.down + # XXX forget it + end +end diff --git a/db/schema.rb b/db/schema.rb index 67a0b47b2..193e50378 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 64) do +ActiveRecord::Schema.define(:version => 65) do create_table "acts_as_xapian_jobs", :force => true do |t| t.string "model", :null => false |