diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/028_give_incoming_messages_events.rb | 2 | ||||
-rw-r--r-- | db/migrate/036_add_public_body_tags.rb | 2 | ||||
-rw-r--r-- | db/migrate/061_include_responses_in_tracks.rb | 2 | ||||
-rw-r--r-- | db/migrate/065_add_comments_to_user_track.rb | 2 | ||||
-rw-r--r-- | db/migrate/088_public_body_machine_tags.rb | 2 | ||||
-rw-r--r-- | db/migrate/090_remove_tag_uniqueness.rb | 2 | ||||
-rw-r--r-- | db/migrate/20140528110536_update_track_things_index.rb | 17 | ||||
-rw-r--r-- | db/migrate/20140801132719_add_index_to_info_request_events.rb | 5 |
8 files changed, 28 insertions, 6 deletions
diff --git a/db/migrate/028_give_incoming_messages_events.rb b/db/migrate/028_give_incoming_messages_events.rb index 831068562..46acd831e 100644 --- a/db/migrate/028_give_incoming_messages_events.rb +++ b/db/migrate/028_give_incoming_messages_events.rb @@ -1,4 +1,4 @@ -# XXX If this one fails with errors about described_state on save, then you need +# TODO: If this one fails with errors about described_state on save, then you need # to temporarily modify the model for InfoRequestEvents to remove this part: # validates_inclusion_of :described_state, :in => [ # Or do some nice hack in here to make it happen permanently :) diff --git a/db/migrate/036_add_public_body_tags.rb b/db/migrate/036_add_public_body_tags.rb index 99a507f13..f7fefdf48 100644 --- a/db/migrate/036_add_public_body_tags.rb +++ b/db/migrate/036_add_public_body_tags.rb @@ -11,7 +11,7 @@ class AddPublicBodyTags < ActiveRecord::Migration end # MySQL cannot index text blobs like this - # XXX perhaps should change :name to be a :string + # TODO: perhaps should change :name to be a :string if ActiveRecord::Base.connection.adapter_name != "MySQL" add_index :public_body_tags, [:public_body_id, :name], :unique => true end diff --git a/db/migrate/061_include_responses_in_tracks.rb b/db/migrate/061_include_responses_in_tracks.rb index f357e57c2..c7a3b26cf 100644 --- a/db/migrate/061_include_responses_in_tracks.rb +++ b/db/migrate/061_include_responses_in_tracks.rb @@ -4,6 +4,6 @@ class IncludeResponsesInTracks < ActiveRecord::Migration end def self.down - # XXX forget it + # TODO: forget it end end diff --git a/db/migrate/065_add_comments_to_user_track.rb b/db/migrate/065_add_comments_to_user_track.rb index 9c4ff2936..50d1f9d5d 100644 --- a/db/migrate/065_add_comments_to_user_track.rb +++ b/db/migrate/065_add_comments_to_user_track.rb @@ -9,6 +9,6 @@ class AddCommentsToUserTrack < ActiveRecord::Migration end def self.down - # XXX forget it + # TODO: forget it end end diff --git a/db/migrate/088_public_body_machine_tags.rb b/db/migrate/088_public_body_machine_tags.rb index 0089607c6..6a0815568 100644 --- a/db/migrate/088_public_body_machine_tags.rb +++ b/db/migrate/088_public_body_machine_tags.rb @@ -3,7 +3,7 @@ class PublicBodyMachineTags < ActiveRecord::Migration add_column :public_body_tags, :value, :text # MySQL cannot index text blobs like this - # XXX perhaps should change :name/:value to be a :string + # TODO: perhaps should change :name/:value to be a :string if ActiveRecord::Base.connection.adapter_name != "MySQL" add_index :public_body_tags, :name end diff --git a/db/migrate/090_remove_tag_uniqueness.rb b/db/migrate/090_remove_tag_uniqueness.rb index 1c06de439..d1affade3 100644 --- a/db/migrate/090_remove_tag_uniqueness.rb +++ b/db/migrate/090_remove_tag_uniqueness.rb @@ -1,7 +1,7 @@ class RemoveTagUniqueness < ActiveRecord::Migration def self.up # MySQL cannot index text blobs like this - # XXX perhaps should change :name/:value to be a :string + # TODO: perhaps should change :name/:value to be a :string if ActiveRecord::Base.connection.adapter_name != "MySQL" remove_index :public_body_tags, [:public_body_id, :name] # allow the key to repeat, but not the value also diff --git a/db/migrate/20140528110536_update_track_things_index.rb b/db/migrate/20140528110536_update_track_things_index.rb new file mode 100644 index 000000000..55ee0b70b --- /dev/null +++ b/db/migrate/20140528110536_update_track_things_index.rb @@ -0,0 +1,17 @@ +class UpdateTrackThingsIndex < ActiveRecord::Migration + + def up + if ActiveRecord::Base.connection.adapter_name == "PostgreSQL" + execute "ALTER TABLE track_things_sent_emails DROP CONSTRAINT fk_track_request_public_body" + execute "ALTER TABLE track_things_sent_emails ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id)" + end + end + + def down + if ActiveRecord::Base.connection.adapter_name == "PostgreSQL" + execute "ALTER TABLE track_things_sent_emails DROP CONSTRAINT fk_track_request_public_body" + execute "ALTER TABLE track_things_sent_emails ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (user_id) REFERENCES users(id)" + end + end + +end diff --git a/db/migrate/20140801132719_add_index_to_info_request_events.rb b/db/migrate/20140801132719_add_index_to_info_request_events.rb new file mode 100644 index 000000000..5f0a77eac --- /dev/null +++ b/db/migrate/20140801132719_add_index_to_info_request_events.rb @@ -0,0 +1,5 @@ +class AddIndexToInfoRequestEvents < ActiveRecord::Migration + def change + add_index :info_request_events, :event_type + end +end |