aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/078_expand_stop_new_responses.rb18
-rw-r--r--db/schema.rb25
2 files changed, 31 insertions, 12 deletions
diff --git a/db/migrate/078_expand_stop_new_responses.rb b/db/migrate/078_expand_stop_new_responses.rb
new file mode 100644
index 000000000..ae0d4db91
--- /dev/null
+++ b/db/migrate/078_expand_stop_new_responses.rb
@@ -0,0 +1,18 @@
+class ExpandStopNewResponses < ActiveRecord::Migration
+ def self.up
+ add_column :info_requests, :allow_new_responses_from, :string
+ InfoRequest.update_all "allow_new_responses_from = 'anybody'"
+ InfoRequest.update_all "allow_new_responses_from = 'nobody' where stop_new_responses"
+ change_column :info_requests, :allow_new_responses_from, :string, :null => false, :default => 'anybody'
+ remove_column :info_requests, :stop_new_responses
+
+ add_column :info_requests, :handle_rejected_responses, :string
+ InfoRequest.update_all "handle_rejected_responses = 'bounce'"
+ change_column :info_requests, :handle_rejected_responses, :string, :null => false, :default => 'bounce'
+ end
+
+ def self.down
+ raise "No code for reversing this"
+ end
+end
+
diff --git a/db/schema.rb b/db/schema.rb
index 2da739ae1..7055727eb 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 => 77) do
+ActiveRecord::Schema.define(:version => 78) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -94,17 +94,18 @@ ActiveRecord::Schema.define(:version => 77) do
add_index "info_request_events", ["info_request_id"], :name => "index_info_request_events_on_info_request_id"
create_table "info_requests", :force => true do |t|
- t.text "title", :null => false
- t.integer "user_id", :null => false
- t.integer "public_body_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "described_state", :null => false
- t.boolean "awaiting_description", :default => false, :null => false
- t.string "prominence", :default => "normal", :null => false
- t.text "url_title", :null => false
- t.boolean "stop_new_responses", :default => false, :null => false
- t.string "law_used", :default => "foi", :null => false
+ t.text "title", :null => false
+ t.integer "user_id", :null => false
+ t.integer "public_body_id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "described_state", :null => false
+ t.boolean "awaiting_description", :default => false, :null => false
+ t.string "prominence", :default => "normal", :null => false
+ t.text "url_title", :null => false
+ t.string "law_used", :default => "foi", :null => false
+ t.string "allow_new_responses_from", :default => "anybody", :null => false
+ t.string "handle_rejected_responses", :default => "bounce", :null => false
end
add_index "info_requests", ["created_at"], :name => "index_info_requests_on_created_at"