diff options
author | Robin Houston <robin.houston@gmail.com> | 2011-08-09 22:28:29 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2011-08-09 22:28:29 +0100 |
commit | 9ba347e592de499c748a1a4e7ebcb1e8f28eb164 (patch) | |
tree | 3886ac0398ffbe612bd4bd4453e0b888445451e7 | |
parent | 7d1eb5df0c1bcc6a7a92755004faf85bc00496d4 (diff) |
Bring the wdtk branch into line with master (no more differences).
-rw-r--r-- | config/routes.rb | 3 | ||||
-rw-r--r-- | db/migrate/099_move_raw_email_to_filesystem.rb | 23 | ||||
-rw-r--r-- | db/migrate/100_remove_redundant_raw_email_columns.rb | 12 |
3 files changed, 36 insertions, 2 deletions
diff --git a/config/routes.rb b/config/routes.rb index d04547b11..c16c10eb9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -196,8 +196,7 @@ ActionController::Routing::Routes.draw do |map| rule.admin_rule_update '/admin/censor/update/:id', :action => 'update' rule.admin_rule_destroy '/admin/censor/destroy/:censor_rule_id', :action => 'destroy' end - - # map.filter('conditionallyprependlocale') + map.filter('conditionallyprependlocale') # Allow downloading Web Service WSDL as a file with an extension # instead of a file named 'wsdl' diff --git a/db/migrate/099_move_raw_email_to_filesystem.rb b/db/migrate/099_move_raw_email_to_filesystem.rb new file mode 100644 index 000000000..ea77580e1 --- /dev/null +++ b/db/migrate/099_move_raw_email_to_filesystem.rb @@ -0,0 +1,23 @@ +class MoveRawEmailToFilesystem < ActiveRecord::Migration + def self.up + batch_size = 10 + 0.step(RawEmail.count, batch_size) do |i| + RawEmail.find(:all, :limit => batch_size, :offset => i, :order => :id).each do |raw_email| + if !File.exists?(raw_email.filepath) + STDERR.puts "converting raw_email " + raw_email.id.to_s + raw_email.data = raw_email.dbdata + #raw_email.dbdata = nil + #raw_email.save! + end + end + end + end + + def self.down + raise "safer not to have reverse migration scripts, and we never use them" + end +end + + + + diff --git a/db/migrate/100_remove_redundant_raw_email_columns.rb b/db/migrate/100_remove_redundant_raw_email_columns.rb new file mode 100644 index 000000000..edf6006d7 --- /dev/null +++ b/db/migrate/100_remove_redundant_raw_email_columns.rb @@ -0,0 +1,12 @@ +class RemoveRedundantRawEmailColumns < ActiveRecord::Migration + def self.up + remove_column :raw_emails, :data_text + remove_column :raw_emails, :data_binary + end + def self.down + end +end + + + + |