aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/006_version_public_body.rb2
-rw-r--r--db/migrate/101_add_hash_to_info_request.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/db/migrate/006_version_public_body.rb b/db/migrate/006_version_public_body.rb
index 34586add2..0e4527133 100644
--- a/db/migrate/006_version_public_body.rb
+++ b/db/migrate/006_version_public_body.rb
@@ -1,6 +1,8 @@
class VersionPublicBody < ActiveRecord::Migration
def self.up
PublicBody.create_versioned_table
+
+ add_timestamps(:public_body_versions)
end
def self.down
diff --git a/db/migrate/101_add_hash_to_info_request.rb b/db/migrate/101_add_hash_to_info_request.rb
index e21bf0989..e38384cd6 100644
--- a/db/migrate/101_add_hash_to_info_request.rb
+++ b/db/migrate/101_add_hash_to_info_request.rb
@@ -5,13 +5,11 @@ class AddHashToInfoRequest < ActiveRecord::Migration
add_column :info_requests, :idhash, :string
# Create the missing events for requests already sent
- InfoRequest.find(:all).each do |info_request|
- info_request.idhash = Digest::SHA1.hexdigest(info_request.id.to_s + Configuration::incoming_email_secret)[0,8]
+ InfoRequest.all.each do |info_request|
+ info_request.idhash = Digest::SHA1.hexdigest(info_request.id.to_s + AlaveteliConfiguration::incoming_email_secret)[0,8]
info_request.save!
- puts info_request.idhash
end
change_column :info_requests, :idhash, :string, :null => false
- puts InfoRequest.find_by_idhash
end
def self.down
remove_column :info_requests, :idhash