diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-09-20 15:06:32 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-09-20 15:06:32 +0100 |
commit | add084ee6047d3cae72e3e445135b122d8ba2cc8 (patch) | |
tree | f9763b73753c44562d6572035ab71b4bae2957a0 /db | |
parent | 69103f5e83d538cd3aa9a3ea39cc5736aaec21e8 (diff) | |
parent | aebcdc082f277b3569d1300ebeda43c503d8aec5 (diff) |
Merge branch 'release/0.6.6'0.6.6
Conflicts:
locale/cs/app.po
locale/es/app.po
Diffstat (limited to 'db')
13 files changed, 135 insertions, 0 deletions
diff --git a/db/migrate/20120910153022_create_request_classifications.rb b/db/migrate/20120910153022_create_request_classifications.rb new file mode 100644 index 000000000..7c6270c9e --- /dev/null +++ b/db/migrate/20120910153022_create_request_classifications.rb @@ -0,0 +1,14 @@ +class CreateRequestClassifications < ActiveRecord::Migration + def self.up + create_table :request_classifications do |t| + t.integer :user_id + t.integer :info_request_event_id + t.timestamps + end + add_index :request_classifications, :user_id + end + + def self.down + drop_table :request_classifications + end +end diff --git a/db/migrate/20120912111713_add_raw_email_index_to_incoming_messages.rb b/db/migrate/20120912111713_add_raw_email_index_to_incoming_messages.rb new file mode 100644 index 000000000..14174935e --- /dev/null +++ b/db/migrate/20120912111713_add_raw_email_index_to_incoming_messages.rb @@ -0,0 +1,9 @@ +class AddRawEmailIndexToIncomingMessages < ActiveRecord::Migration + def self.up + add_index :incoming_messages, :raw_email_id + end + + def self.down + remove_index :incoming_messages, :raw_email_id + end +end diff --git a/db/migrate/20120912112036_add_info_request_id_index_to_exim_logs.rb b/db/migrate/20120912112036_add_info_request_id_index_to_exim_logs.rb new file mode 100644 index 000000000..81e2a7946 --- /dev/null +++ b/db/migrate/20120912112036_add_info_request_id_index_to_exim_logs.rb @@ -0,0 +1,9 @@ +class AddInfoRequestIdIndexToEximLogs < ActiveRecord::Migration + def self.up + add_index :exim_logs, :info_request_id + end + + def self.down + remove_index :exim_logs, :info_request_id + end +end diff --git a/db/migrate/20120912112312_add_info_request_id_index_to_incoming_and_outgoing_messages.rb b/db/migrate/20120912112312_add_info_request_id_index_to_incoming_and_outgoing_messages.rb new file mode 100644 index 000000000..814fa7540 --- /dev/null +++ b/db/migrate/20120912112312_add_info_request_id_index_to_incoming_and_outgoing_messages.rb @@ -0,0 +1,11 @@ +class AddInfoRequestIdIndexToIncomingAndOutgoingMessages < ActiveRecord::Migration + def self.up + add_index :incoming_messages, :info_request_id + add_index :outgoing_messages, :info_request_id + end + + def self.down + remove_index :incoming_messages, :info_request_id + remove_index :outgoing_messages, :info_request_id + end +end diff --git a/db/migrate/20120912112655_add_incoming_message_id_index_to_foi_attachments.rb b/db/migrate/20120912112655_add_incoming_message_id_index_to_foi_attachments.rb new file mode 100644 index 000000000..be0bf76c3 --- /dev/null +++ b/db/migrate/20120912112655_add_incoming_message_id_index_to_foi_attachments.rb @@ -0,0 +1,9 @@ +class AddIncomingMessageIdIndexToFoiAttachments < ActiveRecord::Migration + def self.up + add_index :foi_attachments, :incoming_message_id + end + + def self.down + remove_index :foi_attachments, :incoming_message_id + end +end diff --git a/db/migrate/20120912113004_add_indexes_to_info_request_events.rb b/db/migrate/20120912113004_add_indexes_to_info_request_events.rb new file mode 100644 index 000000000..b3780322f --- /dev/null +++ b/db/migrate/20120912113004_add_indexes_to_info_request_events.rb @@ -0,0 +1,13 @@ +class AddIndexesToInfoRequestEvents < ActiveRecord::Migration + def self.up + add_index :info_request_events, :incoming_message_id + add_index :info_request_events, :outgoing_message_id + add_index :info_request_events, :comment_id + end + + def self.down + remove_index :info_request_events, :incoming_message_id + remove_index :info_request_events, :outgoing_message_id + remove_index :info_request_events, :comment_id + end +end diff --git a/db/migrate/20120912113720_add_public_body_index_to_info_requests.rb b/db/migrate/20120912113720_add_public_body_index_to_info_requests.rb new file mode 100644 index 000000000..a56cad1f9 --- /dev/null +++ b/db/migrate/20120912113720_add_public_body_index_to_info_requests.rb @@ -0,0 +1,9 @@ +class AddPublicBodyIndexToInfoRequests < ActiveRecord::Migration + def self.up + add_index :info_requests, :public_body_id + end + + def self.down + remove_index :info_requests, :public_body_id + end +end diff --git a/db/migrate/20120912114022_add_user_index_to_info_requests.rb b/db/migrate/20120912114022_add_user_index_to_info_requests.rb new file mode 100644 index 000000000..8be51c0c8 --- /dev/null +++ b/db/migrate/20120912114022_add_user_index_to_info_requests.rb @@ -0,0 +1,9 @@ +class AddUserIndexToInfoRequests < ActiveRecord::Migration + def self.up + add_index :info_requests, :user_id + end + + def self.down + remove_index :info_requests, :user_id + end +end diff --git a/db/migrate/20120912170035_add_info_requests_count_to_public_bodies.rb b/db/migrate/20120912170035_add_info_requests_count_to_public_bodies.rb new file mode 100644 index 000000000..d187dcfa5 --- /dev/null +++ b/db/migrate/20120912170035_add_info_requests_count_to_public_bodies.rb @@ -0,0 +1,16 @@ +class AddInfoRequestsCountToPublicBodies < ActiveRecord::Migration + def self.up + add_column :public_bodies, :info_requests_count, :integer, :null => false, :default => 0 + + PublicBody.connection.execute("UPDATE public_bodies + SET info_requests_count = (SELECT COUNT(*) FROM info_requests + WHERE public_body_id = public_bodies.id);") + + + end + + def self.down + remove_column :public_bodies, :info_requests_count + end + +end diff --git a/db/migrate/20120913074940_add_incoming_message_index_to_outgoing_messages.rb b/db/migrate/20120913074940_add_incoming_message_index_to_outgoing_messages.rb new file mode 100644 index 000000000..893395f41 --- /dev/null +++ b/db/migrate/20120913074940_add_incoming_message_index_to_outgoing_messages.rb @@ -0,0 +1,9 @@ +class AddIncomingMessageIndexToOutgoingMessages < ActiveRecord::Migration + def self.up + add_index :outgoing_messages, :incoming_message_followup_id + end + + def self.down + remove_index :outgoing_messages, :incoming_message_followup_id + end +end diff --git a/db/migrate/20120913080807_add_info_request_event_index_to_track_things_sent_emails.rb b/db/migrate/20120913080807_add_info_request_event_index_to_track_things_sent_emails.rb new file mode 100644 index 000000000..d119f55b3 --- /dev/null +++ b/db/migrate/20120913080807_add_info_request_event_index_to_track_things_sent_emails.rb @@ -0,0 +1,9 @@ +class AddInfoRequestEventIndexToTrackThingsSentEmails < ActiveRecord::Migration + def self.up + add_index :track_things_sent_emails, :info_request_event_id + end + + def self.down + remove_index :track_things_sent_emails, :info_request_event_id + end +end diff --git a/db/migrate/20120913081136_add_info_request_event_index_to_user_info_request_sent_alerts.rb b/db/migrate/20120913081136_add_info_request_event_index_to_user_info_request_sent_alerts.rb new file mode 100644 index 000000000..aa9f404f7 --- /dev/null +++ b/db/migrate/20120913081136_add_info_request_event_index_to_user_info_request_sent_alerts.rb @@ -0,0 +1,9 @@ +class AddInfoRequestEventIndexToUserInfoRequestSentAlerts < ActiveRecord::Migration + def self.up + add_index :user_info_request_sent_alerts, :info_request_event_id + end + + def self.down + remove_index :user_info_request_sent_alerts, :info_request_event_id + end +end diff --git a/db/migrate/20120913135745_add_updated_at_index_to_public_body_versions.rb b/db/migrate/20120913135745_add_updated_at_index_to_public_body_versions.rb new file mode 100644 index 000000000..6ae58c884 --- /dev/null +++ b/db/migrate/20120913135745_add_updated_at_index_to_public_body_versions.rb @@ -0,0 +1,9 @@ +class AddUpdatedAtIndexToPublicBodyVersions < ActiveRecord::Migration + def self.up + add_index :public_body_versions, :updated_at + end + + def self.down + remove_index :public_body_versions, :updated_at + end +end |