From f773f6795899c47ca5e48871678d7c5ee13dffc8 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 9 Oct 2017 21:03:46 +0100 Subject: [PATCH 1/2] Update to rails 5.1.4 --- Gemfile | 4 +- Gemfile.lock | 98 +++++++++++++------------- app/helpers/application_helper.rb | 4 +- config/environment.rb | 2 +- config/environments/development.rb | 14 ++++ config/environments/production.rb | 7 +- config/initializers/wrap_parameters.rb | 2 +- lib/rich_text.rb | 4 +- 8 files changed, 77 insertions(+), 58 deletions(-) diff --git a/Gemfile b/Gemfile index ae1b472a2..772e6f300 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" # Require rails -gem "rails", "5.0.6" +gem "rails", "5.1.4" # Require things which have moved to gems in ruby 1.9 gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19 @@ -42,7 +42,7 @@ gem "image_optim_rails" # Load rails plugins gem "actionpack-page_caching" -gem "composite_primary_keys", "~> 9.0.7" +gem "composite_primary_keys", "~> 10.0.0" gem "dynamic_form" gem "http_accept_language", "~> 2.0.0" gem "i18n-js", ">= 3.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 3cd36d5ad..e4b521c1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,56 +2,56 @@ GEM remote: https://rubygems.org/ specs: SystemTimer (1.2.3) - actioncable (5.0.6) - actionpack (= 5.0.6) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.4) + actionpack (= 5.1.4) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.6) - actionview (= 5.0.6) - activesupport (= 5.0.6) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionpack-page_caching (1.1.0) actionpack (>= 4.0.0, < 6) - actionview (5.0.6) - activesupport (= 5.0.6) + actionview (5.1.4) + activesupport (= 5.1.4) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.6) - activesupport (= 5.0.6) + activejob (5.1.4) + activesupport (= 5.1.4) globalid (>= 0.3.6) - activemodel (5.0.6) - activesupport (= 5.0.6) - activerecord (5.0.6) - activemodel (= 5.0.6) - activesupport (= 5.0.6) - arel (~> 7.0) - activesupport (5.0.6) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) + arel (~> 8.0) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (7.1.4) + arel (8.0.0) ast (2.3.0) - autoprefixer-rails (7.1.4.1) + autoprefixer-rails (7.1.5) execjs bigdecimal (1.1.0) builder (3.2.3) canonical-rails (0.2.1) rails (>= 4.1, < 5.2) - capybara (2.15.3) + capybara (2.15.4) addressable mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) @@ -69,8 +69,8 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - composite_primary_keys (9.0.7) - activerecord (~> 5.0.0) + composite_primary_keys (10.0.0) + activerecord (~> 5.1.0) concurrent-ruby (1.0.5) coveralls (0.8.21) json (>= 1.8, < 3) @@ -84,7 +84,7 @@ GEM dalli (2.7.6) docile (1.1.5) dynamic_form (1.1.4) - erubis (2.7.0) + erubi (1.6.1) execjs (2.7.0) exifr (1.3.2) factory_girl (4.8.1) @@ -99,7 +99,7 @@ GEM geoip (1.6.3) globalid (0.4.0) activesupport (>= 4.2.0) - hashdiff (0.3.6) + hashdiff (0.3.7) hashie (3.5.6) htmlentities (4.3.4) http_accept_language (2.0.5) @@ -222,7 +222,7 @@ GEM cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) - progress (3.3.1) + progress (3.3.2) psych (2.2.4) public_suffix (3.0.0) r2 (0.2.7) @@ -231,20 +231,20 @@ GEM rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-test (0.6.3) - rack (>= 1.0) + rack-test (0.7.0) + rack (>= 1.0, < 3) rack-uri_sanitizer (0.0.2) - rails (5.0.6) - actioncable (= 5.0.6) - actionmailer (= 5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) - activemodel (= 5.0.6) - activerecord (= 5.0.6) - activesupport (= 5.0.6) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) bundler (>= 1.3.0) - railties (= 5.0.6) + railties (= 5.1.4) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -258,9 +258,9 @@ GEM rails-i18n (4.0.2) i18n (~> 0.6) rails (>= 4.0) - railties (5.0.6) - actionpack (= 5.0.6) - activesupport (= 5.0.6) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -335,7 +335,7 @@ GEM validates_email_format_of (1.6.3) i18n vendorer (0.1.16) - webmock (3.0.1) + webmock (3.1.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@ -355,7 +355,7 @@ DEPENDENCIES bigdecimal (~> 1.1.0) canonical-rails coffee-rails (~> 4.2) - composite_primary_keys (~> 9.0.7) + composite_primary_keys (~> 10.0.0) coveralls dalli dynamic_form @@ -391,7 +391,7 @@ DEPENDENCIES r2 (~> 0.2.7) rack-cors rack-uri_sanitizer - rails (= 5.0.6) + rails (= 5.1.4) rails-controller-testing rails-i18n (~> 4.0.0) record_tag_helper diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d27b47f27..a330eb5f9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,9 +3,9 @@ module ApplicationHelper def linkify(text) if text.html_safe? - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")).html_safe + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")).html_safe else - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")) + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")) end end diff --git a/config/environment.rb b/config/environment.rb index 171198560..cac531577 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ # Load the Rails application. -require File.expand_path("../application", __FILE__) +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 9101bb1eb..8e7213a9d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,6 +12,20 @@ Rails.application.configure do # Show full error reports. config.consider_all_requests_local = true + # Enable/disable caching. By default caching is disabled. + if Rails.root.join("tmp", "caching-dev.txt").exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.seconds.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false diff --git a/config/environments/production.rb b/config/environments/production.rb index e421abc58..c4c98ad48 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -14,6 +14,11 @@ Rails.application.configure do config.consider_all_requests_local = false config.action_controller.perform_caching = true + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or + # `config/secrets.yml.key`. + config.read_encrypted_secrets = true + # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? @@ -57,7 +62,7 @@ Rails.application.configure do # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "rails50_#{Rails.env}" + # config.active_job.queue_name_prefix = "openstreetmap_#{Rails.env}" config.action_mailer.perform_caching = false # Configure caching of static assets diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 33725e95f..cf733efd1 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -5,7 +5,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) + wrap_parameters format: [:json] end # To enable root element in JSON for ActiveRecord objects. diff --git a/lib/rich_text.rb b/lib/rich_text.rb index db296967b..d0539b2b0 100644 --- a/lib/rich_text.rb +++ b/lib/rich_text.rb @@ -57,9 +57,9 @@ module RichText def linkify(text) if text.html_safe? - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")).html_safe + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")).html_safe else - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")) + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")) end end end From 29a780eb1af9ca5f8b55e53cf89701b297707607 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 9 Oct 2017 21:08:53 +0100 Subject: [PATCH 2/2] Add rails version number to migrations --- db/migrate/001_create_osm_db.rb | 2 +- db/migrate/002_cleanup_osm_db.rb | 2 +- db/migrate/003_sql_session_store_setup.rb | 2 +- db/migrate/004_user_enhancements.rb | 2 +- db/migrate/005_tile_tracepoints.rb | 2 +- db/migrate/006_tile_nodes.rb | 2 +- db/migrate/007_add_relations.rb | 2 +- db/migrate/008_remove_segments.rb | 2 +- db/migrate/009_way_nodes_node_idx.rb | 2 +- db/migrate/010_diary_comments.rb | 2 +- db/migrate/011_add_user_image.rb | 2 +- db/migrate/012_add_admin_flag.rb | 2 +- db/migrate/013_add_email_valid.rb | 2 +- db/migrate/014_add_new_email.rb | 2 +- db/migrate/015_add_user_visible.rb | 2 +- db/migrate/016_add_creation_ip.rb | 2 +- db/migrate/017_add_gpx_indexes.rb | 2 +- db/migrate/018_create_acls.rb | 2 +- db/migrate/019_add_timestamp_indexes.rb | 2 +- db/migrate/020_populate_node_tags_and_remove.rb | 2 +- db/migrate/021_move_to_innodb.rb | 2 +- db/migrate/022_key_constraints.rb | 2 +- db/migrate/023_add_changesets.rb | 2 +- db/migrate/024_order_relation_members.rb | 2 +- db/migrate/025_add_end_time_to_changesets.rb | 2 +- db/migrate/026_add_changeset_user_index.rb | 2 +- db/migrate/027_add_changeset_indexes.rb | 2 +- db/migrate/028_add_more_changeset_indexes.rb | 2 +- db/migrate/029_add_user_foreign_keys.rb | 2 +- db/migrate/030_add_foreign_keys.rb | 2 +- db/migrate/031_create_countries.rb | 2 +- db/migrate/032_add_user_locale.rb | 2 +- db/migrate/033_change_diary_entries_language.rb | 2 +- db/migrate/034_create_languages.rb | 2 +- db/migrate/035_change_user_locale.rb | 2 +- db/migrate/036_add_visible_to_message.rb | 2 +- db/migrate/037_add_sender_visible_to_message.rb | 2 +- db/migrate/038_add_message_sender_index.rb | 2 +- db/migrate/039_add_more_controls_to_gpx_files.rb | 2 +- db/migrate/040_create_oauth_tables.rb | 2 +- db/migrate/041_add_fine_o_auth_permissions.rb | 2 +- db/migrate/042_add_foreign_keys_to_oauth_tables.rb | 2 +- db/migrate/043_add_referer_to_user_token.rb | 2 +- db/migrate/044_create_user_roles.rb | 2 +- db/migrate/045_create_user_blocks.rb | 2 +- db/migrate/046_alter_user_roles_and_blocks.rb | 2 +- db/migrate/047_add_visible_to_diaries.rb | 2 +- db/migrate/048_add_diary_creation_indexes.rb | 2 +- db/migrate/049_improve_changeset_user_index.rb | 2 +- db/migrate/050_add_user_index_to_diary_comments.rb | 2 +- db/migrate/051_add_status_to_user.rb | 2 +- db/migrate/052_add_contributor_terms_to_user.rb | 2 +- db/migrate/053_add_map_bug_tables.rb | 2 +- db/migrate/054_refactor_map_bug_tables.rb | 2 +- db/migrate/055_change_map_bug_comment_type.rb | 2 +- db/migrate/056_add_date_closed.rb | 2 +- db/migrate/057_add_map_bug_comment_event.rb | 2 +- db/migrate/20100513171259_add_user_date_index_to_changeset.rb | 2 +- db/migrate/20100516124737_add_open_id.rb | 2 +- db/migrate/20100910084426_add_callback_to_oauth_tokens.rb | 2 +- db/migrate/20101114011429_add_editor_preference_to_user.rb | 2 +- db/migrate/20110322001319_add_terms_seen_to_user.rb | 2 +- db/migrate/20110508145337_cleanup_bug_tables.rb | 2 +- db/migrate/20110521142405_rename_bugs_to_notes.rb | 2 +- db/migrate/20110925112722_rename_ids.rb | 2 +- db/migrate/20111116184519_update_oauth.rb | 2 +- db/migrate/20111212183945_add_lowercase_user_indexes.rb | 2 +- db/migrate/20120123184321_switch_to_paperclip.rb | 2 +- db/migrate/20120208122334_merge_acl_address_and_mask.rb | 2 +- db/migrate/20120208194454_add_domain_to_acl.rb | 2 +- db/migrate/20120214210114_add_text_format.rb | 2 +- db/migrate/20120219161649_add_user_image_fingerprint.rb | 2 +- db/migrate/20120318201948_create_redactions.rb | 2 +- db/migrate/20120328090602_drop_session_table.rb | 2 +- .../20120404205604_add_user_and_description_to_redaction.rb | 2 +- db/migrate/20120808231205_add_counter_caches.rb | 2 +- db/migrate/20121005195010_add_diary_entry_counter_caches.rb | 2 +- db/migrate/20121012044047_add_image_use_gravatar_to_users.rb | 2 +- db/migrate/20121119165817_drop_nearby_place_from_notes.rb | 2 +- .../20121202155309_remove_author_name_from_note_comment.rb | 2 +- db/migrate/20121203124841_change_note_address_to_inet.rb | 2 +- db/migrate/20130328184137_add_write_notes_permission.rb | 2 +- .../20131212124700_add_created_at_index_to_note_comments.rb | 2 +- db/migrate/20140115192822_add_text_index_to_note_comments.rb | 2 +- db/migrate/20140117185510_drop_countries.rb | 2 +- db/migrate/20140210003018_add_user_image_content_type.rb | 2 +- db/migrate/20140507110937_create_changeset_comments.rb | 2 +- ...0140519141742_add_join_table_between_users_and_changesets.rb | 2 +- db/migrate/20150110152606_change_default_formats.rb | 2 +- db/migrate/20150111192335_subscribe_old_changesets.rb | 2 +- db/migrate/20150222101847_rename_openid_url.rb | 2 +- .../20150818224516_set_default_gravatar_to_false_for_privacy.rb | 2 +- ...1002153425_add_join_table_between_users_and_diary_entries.rb | 2 +- db/migrate/20161011010929_subscribe_authors_to_diary_entries.rb | 2 +- db/migrate/20170222134109_add_user_indexes.rb | 2 +- 95 files changed, 95 insertions(+), 95 deletions(-) diff --git a/db/migrate/001_create_osm_db.rb b/db/migrate/001_create_osm_db.rb index 3935fb6b0..2edb658e4 100644 --- a/db/migrate/001_create_osm_db.rb +++ b/db/migrate/001_create_osm_db.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateOsmDb < ActiveRecord::Migration +class CreateOsmDb < ActiveRecord::Migration[5.0] def self.up create_table "current_nodes", :id => false do |t| t.column "id", :bigint, :null => false diff --git a/db/migrate/002_cleanup_osm_db.rb b/db/migrate/002_cleanup_osm_db.rb index 0710417e3..92a4f671a 100644 --- a/db/migrate/002_cleanup_osm_db.rb +++ b/db/migrate/002_cleanup_osm_db.rb @@ -1,6 +1,6 @@ require "migrate" -class CleanupOsmDb < ActiveRecord::Migration +class CleanupOsmDb < ActiveRecord::Migration[5.0] def self.up change_column "current_nodes", "latitude", :float, :limit => 53, :null => false change_column "current_nodes", "longitude", :float, :limit => 53, :null => false diff --git a/db/migrate/003_sql_session_store_setup.rb b/db/migrate/003_sql_session_store_setup.rb index 9531ccc5e..47c711daf 100644 --- a/db/migrate/003_sql_session_store_setup.rb +++ b/db/migrate/003_sql_session_store_setup.rb @@ -1,6 +1,6 @@ require "migrate" -class SqlSessionStoreSetup < ActiveRecord::Migration +class SqlSessionStoreSetup < ActiveRecord::Migration[5.0] def self.up create_table "sessions" do |t| t.column "session_id", :string diff --git a/db/migrate/004_user_enhancements.rb b/db/migrate/004_user_enhancements.rb index f45d441ab..68c6cd1de 100644 --- a/db/migrate/004_user_enhancements.rb +++ b/db/migrate/004_user_enhancements.rb @@ -1,6 +1,6 @@ require "migrate" -class UserEnhancements < ActiveRecord::Migration +class UserEnhancements < ActiveRecord::Migration[5.0] def self.up add_column "diary_entries", "latitude", :float, :limit => 53 add_column "diary_entries", "longitude", :float, :limit => 53 diff --git a/db/migrate/005_tile_tracepoints.rb b/db/migrate/005_tile_tracepoints.rb index 00e5af293..2433c3f4f 100644 --- a/db/migrate/005_tile_tracepoints.rb +++ b/db/migrate/005_tile_tracepoints.rb @@ -1,6 +1,6 @@ require "migrate" -class TileTracepoints < ActiveRecord::Migration +class TileTracepoints < ActiveRecord::Migration[5.0] def self.up add_column "gps_points", "tile", :bigint add_index "gps_points", ["tile"], :name => "points_tile_idx" diff --git a/db/migrate/006_tile_nodes.rb b/db/migrate/006_tile_nodes.rb index 1f27ec79e..138168a7b 100644 --- a/db/migrate/006_tile_nodes.rb +++ b/db/migrate/006_tile_nodes.rb @@ -1,6 +1,6 @@ require "migrate" -class TileNodes < ActiveRecord::Migration +class TileNodes < ActiveRecord::Migration[5.0] def self.upgrade_table(from_table, to_table, model) if ENV["USE_DB_FUNCTIONS"] execute <<-SQL diff --git a/db/migrate/007_add_relations.rb b/db/migrate/007_add_relations.rb index 12684abc8..258f1c5bc 100644 --- a/db/migrate/007_add_relations.rb +++ b/db/migrate/007_add_relations.rb @@ -1,6 +1,6 @@ require "migrate" -class AddRelations < ActiveRecord::Migration +class AddRelations < ActiveRecord::Migration[5.0] def self.up # enums work like strings but are more efficient create_enumeration :nwr_enum, %w[Node Way Relation] diff --git a/db/migrate/008_remove_segments.rb b/db/migrate/008_remove_segments.rb index fe3716152..5c9bd1c39 100644 --- a/db/migrate/008_remove_segments.rb +++ b/db/migrate/008_remove_segments.rb @@ -1,6 +1,6 @@ require "migrate" -class RemoveSegments < ActiveRecord::Migration +class RemoveSegments < ActiveRecord::Migration[5.0] def self.up have_segs = select_value("SELECT count(*) FROM current_segments").to_i.nonzero? diff --git a/db/migrate/009_way_nodes_node_idx.rb b/db/migrate/009_way_nodes_node_idx.rb index ccbc9a5a2..dc4ca41ff 100644 --- a/db/migrate/009_way_nodes_node_idx.rb +++ b/db/migrate/009_way_nodes_node_idx.rb @@ -1,4 +1,4 @@ -class WayNodesNodeIdx < ActiveRecord::Migration +class WayNodesNodeIdx < ActiveRecord::Migration[5.0] def self.up add_index "way_nodes", ["node_id"], :name => "way_nodes_node_idx" end diff --git a/db/migrate/010_diary_comments.rb b/db/migrate/010_diary_comments.rb index ac0f5e23a..00912988e 100644 --- a/db/migrate/010_diary_comments.rb +++ b/db/migrate/010_diary_comments.rb @@ -1,6 +1,6 @@ require "migrate" -class DiaryComments < ActiveRecord::Migration +class DiaryComments < ActiveRecord::Migration[5.0] def self.up create_table "diary_comments", :id => false do |t| t.column "id", :bigserial, :primary_key => true, :null => false diff --git a/db/migrate/011_add_user_image.rb b/db/migrate/011_add_user_image.rb index 807e93d59..c25afb413 100644 --- a/db/migrate/011_add_user_image.rb +++ b/db/migrate/011_add_user_image.rb @@ -1,4 +1,4 @@ -class AddUserImage < ActiveRecord::Migration +class AddUserImage < ActiveRecord::Migration[5.0] def self.up add_column "users", "image", :text end diff --git a/db/migrate/012_add_admin_flag.rb b/db/migrate/012_add_admin_flag.rb index 24f2d4ed7..d409f9f1e 100644 --- a/db/migrate/012_add_admin_flag.rb +++ b/db/migrate/012_add_admin_flag.rb @@ -1,4 +1,4 @@ -class AddAdminFlag < ActiveRecord::Migration +class AddAdminFlag < ActiveRecord::Migration[5.0] def self.up add_column "users", "administrator", :boolean, :default => false, :null => false end diff --git a/db/migrate/013_add_email_valid.rb b/db/migrate/013_add_email_valid.rb index 8552c2733..4e9112957 100644 --- a/db/migrate/013_add_email_valid.rb +++ b/db/migrate/013_add_email_valid.rb @@ -1,4 +1,4 @@ -class AddEmailValid < ActiveRecord::Migration +class AddEmailValid < ActiveRecord::Migration[5.0] def self.up add_column "users", "email_valid", :boolean, :default => false, :null => false User.update_all("email_valid = (active != 0)") # email_valid is :boolean, but active is :integer. "email_valid = active" (see r11802 or earlier) will fail for stricter dbs than mysql diff --git a/db/migrate/014_add_new_email.rb b/db/migrate/014_add_new_email.rb index 4077b7ca3..e9e547738 100644 --- a/db/migrate/014_add_new_email.rb +++ b/db/migrate/014_add_new_email.rb @@ -1,4 +1,4 @@ -class AddNewEmail < ActiveRecord::Migration +class AddNewEmail < ActiveRecord::Migration[5.0] def self.up add_column "users", "new_email", :string end diff --git a/db/migrate/015_add_user_visible.rb b/db/migrate/015_add_user_visible.rb index 869f24c37..561c767c3 100644 --- a/db/migrate/015_add_user_visible.rb +++ b/db/migrate/015_add_user_visible.rb @@ -1,4 +1,4 @@ -class AddUserVisible < ActiveRecord::Migration +class AddUserVisible < ActiveRecord::Migration[5.0] def self.up add_column "users", "visible", :boolean, :default => true, :null => false User.update_all(:visible => true) diff --git a/db/migrate/016_add_creation_ip.rb b/db/migrate/016_add_creation_ip.rb index 341566940..0bcdb856f 100644 --- a/db/migrate/016_add_creation_ip.rb +++ b/db/migrate/016_add_creation_ip.rb @@ -1,4 +1,4 @@ -class AddCreationIp < ActiveRecord::Migration +class AddCreationIp < ActiveRecord::Migration[5.0] def self.up add_column "users", "creation_ip", :string end diff --git a/db/migrate/017_add_gpx_indexes.rb b/db/migrate/017_add_gpx_indexes.rb index 1778dcc75..72d28bb2d 100644 --- a/db/migrate/017_add_gpx_indexes.rb +++ b/db/migrate/017_add_gpx_indexes.rb @@ -1,4 +1,4 @@ -class AddGpxIndexes < ActiveRecord::Migration +class AddGpxIndexes < ActiveRecord::Migration[5.0] def self.up add_index "gpx_files", ["user_id"], :name => "gpx_files_user_id_idx" add_index "gpx_file_tags", ["tag"], :name => "gpx_file_tags_tag_idx" diff --git a/db/migrate/018_create_acls.rb b/db/migrate/018_create_acls.rb index e5a524dc1..f4fb0799d 100644 --- a/db/migrate/018_create_acls.rb +++ b/db/migrate/018_create_acls.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateAcls < ActiveRecord::Migration +class CreateAcls < ActiveRecord::Migration[5.0] def self.up create_table "acls", :id => false do |t| t.column "id", :primary_key, :null => false diff --git a/db/migrate/019_add_timestamp_indexes.rb b/db/migrate/019_add_timestamp_indexes.rb index c6b3bc7c2..8122fe1b2 100644 --- a/db/migrate/019_add_timestamp_indexes.rb +++ b/db/migrate/019_add_timestamp_indexes.rb @@ -1,4 +1,4 @@ -class AddTimestampIndexes < ActiveRecord::Migration +class AddTimestampIndexes < ActiveRecord::Migration[5.0] def self.up add_index :current_ways, :timestamp, :name => :current_ways_timestamp_idx add_index :current_relations, :timestamp, :name => :current_relations_timestamp_idx diff --git a/db/migrate/020_populate_node_tags_and_remove.rb b/db/migrate/020_populate_node_tags_and_remove.rb index e2d253d17..2a81a2b9a 100644 --- a/db/migrate/020_populate_node_tags_and_remove.rb +++ b/db/migrate/020_populate_node_tags_and_remove.rb @@ -1,6 +1,6 @@ require "migrate" -class PopulateNodeTagsAndRemove < ActiveRecord::Migration +class PopulateNodeTagsAndRemove < ActiveRecord::Migration[5.0] def self.up have_nodes = select_value("SELECT count(*) FROM current_nodes").to_i.nonzero? diff --git a/db/migrate/021_move_to_innodb.rb b/db/migrate/021_move_to_innodb.rb index 6ef3587d1..5be81b695 100644 --- a/db/migrate/021_move_to_innodb.rb +++ b/db/migrate/021_move_to_innodb.rb @@ -1,6 +1,6 @@ require "migrate" -class MoveToInnodb < ActiveRecord::Migration +class MoveToInnodb < ActiveRecord::Migration[5.0] @conv_tables = %w[nodes ways way_tags way_nodes current_way_tags relation_members relations relation_tags current_relation_tags] @ver_tbl = %w[nodes ways relations] diff --git a/db/migrate/022_key_constraints.rb b/db/migrate/022_key_constraints.rb index 5a6a9296f..535d7d21d 100644 --- a/db/migrate/022_key_constraints.rb +++ b/db/migrate/022_key_constraints.rb @@ -1,6 +1,6 @@ require "migrate" -class KeyConstraints < ActiveRecord::Migration +class KeyConstraints < ActiveRecord::Migration[5.0] def self.up # Primary keys add_primary_key :current_node_tags, [:id, :k] diff --git a/db/migrate/023_add_changesets.rb b/db/migrate/023_add_changesets.rb index 8265353a7..8d19fc1c3 100644 --- a/db/migrate/023_add_changesets.rb +++ b/db/migrate/023_add_changesets.rb @@ -1,6 +1,6 @@ require "migrate" -class AddChangesets < ActiveRecord::Migration +class AddChangesets < ActiveRecord::Migration[5.0] @conv_user_tables = %w[current_nodes current_relations current_ways nodes relations ways] def self.up diff --git a/db/migrate/024_order_relation_members.rb b/db/migrate/024_order_relation_members.rb index fbb276dd5..e773da3cd 100644 --- a/db/migrate/024_order_relation_members.rb +++ b/db/migrate/024_order_relation_members.rb @@ -1,6 +1,6 @@ require "migrate" -class OrderRelationMembers < ActiveRecord::Migration +class OrderRelationMembers < ActiveRecord::Migration[5.0] def self.up # add sequence column. rails won't let us define an ordering here, # as defaults must be constant. diff --git a/db/migrate/025_add_end_time_to_changesets.rb b/db/migrate/025_add_end_time_to_changesets.rb index 4255c6f67..5bd2d5879 100644 --- a/db/migrate/025_add_end_time_to_changesets.rb +++ b/db/migrate/025_add_end_time_to_changesets.rb @@ -1,6 +1,6 @@ require "migrate" -class AddEndTimeToChangesets < ActiveRecord::Migration +class AddEndTimeToChangesets < ActiveRecord::Migration[5.0] def self.up # swap the boolean closed-or-not for a time when the changeset will # close or has closed. diff --git a/db/migrate/026_add_changeset_user_index.rb b/db/migrate/026_add_changeset_user_index.rb index fed0af7c0..049fdc760 100644 --- a/db/migrate/026_add_changeset_user_index.rb +++ b/db/migrate/026_add_changeset_user_index.rb @@ -1,4 +1,4 @@ -class AddChangesetUserIndex < ActiveRecord::Migration +class AddChangesetUserIndex < ActiveRecord::Migration[5.0] def self.up add_index "changesets", ["user_id"], :name => "changesets_user_id_idx" end diff --git a/db/migrate/027_add_changeset_indexes.rb b/db/migrate/027_add_changeset_indexes.rb index 0d4bba0e8..26b96bfba 100644 --- a/db/migrate/027_add_changeset_indexes.rb +++ b/db/migrate/027_add_changeset_indexes.rb @@ -1,4 +1,4 @@ -class AddChangesetIndexes < ActiveRecord::Migration +class AddChangesetIndexes < ActiveRecord::Migration[5.0] def self.up add_index "nodes", ["changeset_id"], :name => "nodes_changeset_id_idx" add_index "ways", ["changeset_id"], :name => "ways_changeset_id_idx" diff --git a/db/migrate/028_add_more_changeset_indexes.rb b/db/migrate/028_add_more_changeset_indexes.rb index 8fc9345a3..4f07b9d58 100644 --- a/db/migrate/028_add_more_changeset_indexes.rb +++ b/db/migrate/028_add_more_changeset_indexes.rb @@ -1,6 +1,6 @@ require "migrate" -class AddMoreChangesetIndexes < ActiveRecord::Migration +class AddMoreChangesetIndexes < ActiveRecord::Migration[5.0] def self.up add_index "changesets", ["created_at"], :name => "changesets_created_at_idx" add_index "changesets", ["closed_at"], :name => "changesets_closed_at_idx" diff --git a/db/migrate/029_add_user_foreign_keys.rb b/db/migrate/029_add_user_foreign_keys.rb index 224d589a8..84771f826 100644 --- a/db/migrate/029_add_user_foreign_keys.rb +++ b/db/migrate/029_add_user_foreign_keys.rb @@ -1,6 +1,6 @@ require "migrate" -class AddUserForeignKeys < ActiveRecord::Migration +class AddUserForeignKeys < ActiveRecord::Migration[5.0] def change add_foreign_key :changesets, :users, :name => "changesets_user_id_fkey" add_foreign_key :diary_comments, :users, :name => "diary_comments_user_id_fkey" diff --git a/db/migrate/030_add_foreign_keys.rb b/db/migrate/030_add_foreign_keys.rb index 02d9813bd..d55c96380 100644 --- a/db/migrate/030_add_foreign_keys.rb +++ b/db/migrate/030_add_foreign_keys.rb @@ -1,6 +1,6 @@ require "migrate" -class AddForeignKeys < ActiveRecord::Migration +class AddForeignKeys < ActiveRecord::Migration[5.0] def self.up add_foreign_key :changeset_tags, :changesets, :column => :id, :name => "changeset_tags_id_fkey" add_foreign_key :diary_comments, :diary_entries, :name => "diary_comments_diary_entry_id_fkey" diff --git a/db/migrate/031_create_countries.rb b/db/migrate/031_create_countries.rb index b146cbadb..180605b26 100644 --- a/db/migrate/031_create_countries.rb +++ b/db/migrate/031_create_countries.rb @@ -1,7 +1,7 @@ require "migrate" require "rexml/document" -class CreateCountries < ActiveRecord::Migration +class CreateCountries < ActiveRecord::Migration[5.0] def self.up create_table :countries, :id => false do |t| t.column :id, :primary_key, :null => false diff --git a/db/migrate/032_add_user_locale.rb b/db/migrate/032_add_user_locale.rb index de3654775..cf5f05808 100644 --- a/db/migrate/032_add_user_locale.rb +++ b/db/migrate/032_add_user_locale.rb @@ -1,4 +1,4 @@ -class AddUserLocale < ActiveRecord::Migration +class AddUserLocale < ActiveRecord::Migration[5.0] def self.up add_column "users", "locale", :string end diff --git a/db/migrate/033_change_diary_entries_language.rb b/db/migrate/033_change_diary_entries_language.rb index 674ae3d49..db011d83f 100644 --- a/db/migrate/033_change_diary_entries_language.rb +++ b/db/migrate/033_change_diary_entries_language.rb @@ -1,4 +1,4 @@ -class ChangeDiaryEntriesLanguage < ActiveRecord::Migration +class ChangeDiaryEntriesLanguage < ActiveRecord::Migration[5.0] def self.up remove_column "diary_entries", "language" add_column "diary_entries", "language_code", :string, :null => false, :default => "en" diff --git a/db/migrate/034_create_languages.rb b/db/migrate/034_create_languages.rb index c41856e1e..603ad3066 100644 --- a/db/migrate/034_create_languages.rb +++ b/db/migrate/034_create_languages.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateLanguages < ActiveRecord::Migration +class CreateLanguages < ActiveRecord::Migration[5.0] def change create_table :languages, :id => false do |t| t.string :code, :null => false diff --git a/db/migrate/035_change_user_locale.rb b/db/migrate/035_change_user_locale.rb index cfdb657f2..4155fbced 100644 --- a/db/migrate/035_change_user_locale.rb +++ b/db/migrate/035_change_user_locale.rb @@ -1,6 +1,6 @@ require "migrate" -class ChangeUserLocale < ActiveRecord::Migration +class ChangeUserLocale < ActiveRecord::Migration[5.0] def self.up remove_foreign_key :users, :column => :locale, :name => "users_locale_fkey" diff --git a/db/migrate/036_add_visible_to_message.rb b/db/migrate/036_add_visible_to_message.rb index 22b121951..ecbe2d0d1 100644 --- a/db/migrate/036_add_visible_to_message.rb +++ b/db/migrate/036_add_visible_to_message.rb @@ -1,4 +1,4 @@ -class AddVisibleToMessage < ActiveRecord::Migration +class AddVisibleToMessage < ActiveRecord::Migration[5.0] def self.up add_column :messages, :visible, :boolean, :default => true, :null => false end diff --git a/db/migrate/037_add_sender_visible_to_message.rb b/db/migrate/037_add_sender_visible_to_message.rb index 305473a62..4ab347388 100644 --- a/db/migrate/037_add_sender_visible_to_message.rb +++ b/db/migrate/037_add_sender_visible_to_message.rb @@ -1,4 +1,4 @@ -class AddSenderVisibleToMessage < ActiveRecord::Migration +class AddSenderVisibleToMessage < ActiveRecord::Migration[5.0] def self.up rename_column :messages, :visible, :to_user_visible add_column :messages, :from_user_visible, :boolean, :default => true, :null => false diff --git a/db/migrate/038_add_message_sender_index.rb b/db/migrate/038_add_message_sender_index.rb index 723ef7814..0df145711 100644 --- a/db/migrate/038_add_message_sender_index.rb +++ b/db/migrate/038_add_message_sender_index.rb @@ -1,4 +1,4 @@ -class AddMessageSenderIndex < ActiveRecord::Migration +class AddMessageSenderIndex < ActiveRecord::Migration[5.0] def self.up add_index :messages, [:from_user_id], :name => "messages_from_user_id_idx" end diff --git a/db/migrate/039_add_more_controls_to_gpx_files.rb b/db/migrate/039_add_more_controls_to_gpx_files.rb index 5a905c044..945a7021d 100644 --- a/db/migrate/039_add_more_controls_to_gpx_files.rb +++ b/db/migrate/039_add_more_controls_to_gpx_files.rb @@ -1,6 +1,6 @@ require "migrate" -class AddMoreControlsToGpxFiles < ActiveRecord::Migration +class AddMoreControlsToGpxFiles < ActiveRecord::Migration[5.0] def self.up create_enumeration :gpx_visibility_enum, %w[private public trackable identifiable] add_column :gpx_files, :visibility, :gpx_visibility_enum, :default => "public", :null => false diff --git a/db/migrate/040_create_oauth_tables.rb b/db/migrate/040_create_oauth_tables.rb index a2eeeca7a..e718bbc17 100644 --- a/db/migrate/040_create_oauth_tables.rb +++ b/db/migrate/040_create_oauth_tables.rb @@ -1,4 +1,4 @@ -class CreateOauthTables < ActiveRecord::Migration +class CreateOauthTables < ActiveRecord::Migration[5.0] def self.up create_table :client_applications do |t| t.string :name diff --git a/db/migrate/041_add_fine_o_auth_permissions.rb b/db/migrate/041_add_fine_o_auth_permissions.rb index c37dc2c1b..3ce10c4e6 100644 --- a/db/migrate/041_add_fine_o_auth_permissions.rb +++ b/db/migrate/041_add_fine_o_auth_permissions.rb @@ -1,4 +1,4 @@ -class AddFineOAuthPermissions < ActiveRecord::Migration +class AddFineOAuthPermissions < ActiveRecord::Migration[5.0] PERMISSIONS = [:allow_read_prefs, :allow_write_prefs, :allow_write_diary, :allow_write_api, :allow_read_gpx, :allow_write_gpx].freeze def self.up diff --git a/db/migrate/042_add_foreign_keys_to_oauth_tables.rb b/db/migrate/042_add_foreign_keys_to_oauth_tables.rb index f8e36711f..4268dddd1 100644 --- a/db/migrate/042_add_foreign_keys_to_oauth_tables.rb +++ b/db/migrate/042_add_foreign_keys_to_oauth_tables.rb @@ -1,6 +1,6 @@ require "migrate" -class AddForeignKeysToOauthTables < ActiveRecord::Migration +class AddForeignKeysToOauthTables < ActiveRecord::Migration[5.0] def change add_foreign_key :oauth_tokens, :users, :name => "oauth_tokens_user_id_fkey" add_foreign_key :oauth_tokens, :client_applications, :name => "oauth_tokens_client_application_id_fkey" diff --git a/db/migrate/043_add_referer_to_user_token.rb b/db/migrate/043_add_referer_to_user_token.rb index 554cc937e..0bfe07073 100644 --- a/db/migrate/043_add_referer_to_user_token.rb +++ b/db/migrate/043_add_referer_to_user_token.rb @@ -1,4 +1,4 @@ -class AddRefererToUserToken < ActiveRecord::Migration +class AddRefererToUserToken < ActiveRecord::Migration[5.0] def self.up add_column :user_tokens, :referer, :text end diff --git a/db/migrate/044_create_user_roles.rb b/db/migrate/044_create_user_roles.rb index e5cf07cd3..3a3fa3faf 100644 --- a/db/migrate/044_create_user_roles.rb +++ b/db/migrate/044_create_user_roles.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateUserRoles < ActiveRecord::Migration +class CreateUserRoles < ActiveRecord::Migration[5.0] def self.up create_enumeration :user_role_enum, %w[administrator moderator] diff --git a/db/migrate/045_create_user_blocks.rb b/db/migrate/045_create_user_blocks.rb index 71081f5c1..3ccd522f9 100644 --- a/db/migrate/045_create_user_blocks.rb +++ b/db/migrate/045_create_user_blocks.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateUserBlocks < ActiveRecord::Migration +class CreateUserBlocks < ActiveRecord::Migration[5.0] def change create_table :user_blocks do |t| t.column :user_id, :bigint, :null => false diff --git a/db/migrate/046_alter_user_roles_and_blocks.rb b/db/migrate/046_alter_user_roles_and_blocks.rb index 5957b13ba..812572e23 100644 --- a/db/migrate/046_alter_user_roles_and_blocks.rb +++ b/db/migrate/046_alter_user_roles_and_blocks.rb @@ -1,6 +1,6 @@ require "migrate" -class AlterUserRolesAndBlocks < ActiveRecord::Migration +class AlterUserRolesAndBlocks < ActiveRecord::Migration[5.0] def self.up # the initial granter IDs can be "self" - there are none of these # in the current live DB, but there may be some in people's own local diff --git a/db/migrate/047_add_visible_to_diaries.rb b/db/migrate/047_add_visible_to_diaries.rb index 994bebd17..4e76f04ca 100644 --- a/db/migrate/047_add_visible_to_diaries.rb +++ b/db/migrate/047_add_visible_to_diaries.rb @@ -1,4 +1,4 @@ -class AddVisibleToDiaries < ActiveRecord::Migration +class AddVisibleToDiaries < ActiveRecord::Migration[5.0] def self.up add_column :diary_entries, :visible, :boolean, :null => false, :default => true add_column :diary_comments, :visible, :boolean, :null => false, :default => true diff --git a/db/migrate/048_add_diary_creation_indexes.rb b/db/migrate/048_add_diary_creation_indexes.rb index d99831a3a..54edfe065 100644 --- a/db/migrate/048_add_diary_creation_indexes.rb +++ b/db/migrate/048_add_diary_creation_indexes.rb @@ -1,4 +1,4 @@ -class AddDiaryCreationIndexes < ActiveRecord::Migration +class AddDiaryCreationIndexes < ActiveRecord::Migration[5.0] def self.up add_index :diary_entries, [:created_at], :name => "diary_entry_created_at_index" add_index :diary_entries, [:user_id, :created_at], :name => "diary_entry_user_id_created_at_index" diff --git a/db/migrate/049_improve_changeset_user_index.rb b/db/migrate/049_improve_changeset_user_index.rb index f02a63dcb..824911327 100644 --- a/db/migrate/049_improve_changeset_user_index.rb +++ b/db/migrate/049_improve_changeset_user_index.rb @@ -1,4 +1,4 @@ -class ImproveChangesetUserIndex < ActiveRecord::Migration +class ImproveChangesetUserIndex < ActiveRecord::Migration[5.0] def self.up add_index :changesets, [:user_id, :id], :name => "changesets_user_id_id_idx" remove_index :changesets, :name => "changesets_user_id_idx" diff --git a/db/migrate/050_add_user_index_to_diary_comments.rb b/db/migrate/050_add_user_index_to_diary_comments.rb index e1fe0def2..48e0593ba 100644 --- a/db/migrate/050_add_user_index_to_diary_comments.rb +++ b/db/migrate/050_add_user_index_to_diary_comments.rb @@ -1,4 +1,4 @@ -class AddUserIndexToDiaryComments < ActiveRecord::Migration +class AddUserIndexToDiaryComments < ActiveRecord::Migration[5.0] def self.up add_index :diary_comments, [:user_id, :created_at], :name => "diary_comment_user_id_created_at_index" end diff --git a/db/migrate/051_add_status_to_user.rb b/db/migrate/051_add_status_to_user.rb index f3a550c60..d3adcee33 100644 --- a/db/migrate/051_add_status_to_user.rb +++ b/db/migrate/051_add_status_to_user.rb @@ -1,6 +1,6 @@ require "migrate" -class AddStatusToUser < ActiveRecord::Migration +class AddStatusToUser < ActiveRecord::Migration[5.0] def self.up create_enumeration :user_status_enum, %w[pending active confirmed suspended deleted] diff --git a/db/migrate/052_add_contributor_terms_to_user.rb b/db/migrate/052_add_contributor_terms_to_user.rb index f2eae9047..01835b981 100644 --- a/db/migrate/052_add_contributor_terms_to_user.rb +++ b/db/migrate/052_add_contributor_terms_to_user.rb @@ -1,4 +1,4 @@ -class AddContributorTermsToUser < ActiveRecord::Migration +class AddContributorTermsToUser < ActiveRecord::Migration[5.0] def self.up add_column :users, :terms_agreed, :datetime add_column :users, :consider_pd, :boolean, :null => false, :default => false diff --git a/db/migrate/053_add_map_bug_tables.rb b/db/migrate/053_add_map_bug_tables.rb index 0ad968d0a..aac3c11c4 100644 --- a/db/migrate/053_add_map_bug_tables.rb +++ b/db/migrate/053_add_map_bug_tables.rb @@ -1,6 +1,6 @@ require "migrate" -class AddMapBugTables < ActiveRecord::Migration +class AddMapBugTables < ActiveRecord::Migration[5.0] def self.up create_enumeration :map_bug_status_enum, %w[open closed hidden] diff --git a/db/migrate/054_refactor_map_bug_tables.rb b/db/migrate/054_refactor_map_bug_tables.rb index 70ed81e45..e29ec0704 100644 --- a/db/migrate/054_refactor_map_bug_tables.rb +++ b/db/migrate/054_refactor_map_bug_tables.rb @@ -1,6 +1,6 @@ require "migrate" -class RefactorMapBugTables < ActiveRecord::Migration +class RefactorMapBugTables < ActiveRecord::Migration[5.0] def self.up create_table :map_bug_comment do |t| t.column :bug_id, :bigint, :null => false diff --git a/db/migrate/055_change_map_bug_comment_type.rb b/db/migrate/055_change_map_bug_comment_type.rb index 4f979da98..6b8407623 100644 --- a/db/migrate/055_change_map_bug_comment_type.rb +++ b/db/migrate/055_change_map_bug_comment_type.rb @@ -1,6 +1,6 @@ require "migrate" -class ChangeMapBugCommentType < ActiveRecord::Migration +class ChangeMapBugCommentType < ActiveRecord::Migration[5.0] def self.up change_column :map_bug_comment, :comment, :text end diff --git a/db/migrate/056_add_date_closed.rb b/db/migrate/056_add_date_closed.rb index 50aeb6c4f..7b1a3233d 100644 --- a/db/migrate/056_add_date_closed.rb +++ b/db/migrate/056_add_date_closed.rb @@ -1,6 +1,6 @@ require "migrate" -class AddDateClosed < ActiveRecord::Migration +class AddDateClosed < ActiveRecord::Migration[5.0] def self.up add_column :map_bugs, :date_closed, :timestamp end diff --git a/db/migrate/057_add_map_bug_comment_event.rb b/db/migrate/057_add_map_bug_comment_event.rb index 6ba2b5a76..0d1a2c8ab 100644 --- a/db/migrate/057_add_map_bug_comment_event.rb +++ b/db/migrate/057_add_map_bug_comment_event.rb @@ -1,6 +1,6 @@ require "migrate" -class AddMapBugCommentEvent < ActiveRecord::Migration +class AddMapBugCommentEvent < ActiveRecord::Migration[5.0] def self.up create_enumeration :map_bug_event_enum, %w[opened closed reopened commented hidden] diff --git a/db/migrate/20100513171259_add_user_date_index_to_changeset.rb b/db/migrate/20100513171259_add_user_date_index_to_changeset.rb index f1d7f43e8..7c9c13782 100644 --- a/db/migrate/20100513171259_add_user_date_index_to_changeset.rb +++ b/db/migrate/20100513171259_add_user_date_index_to_changeset.rb @@ -1,4 +1,4 @@ -class AddUserDateIndexToChangeset < ActiveRecord::Migration +class AddUserDateIndexToChangeset < ActiveRecord::Migration[5.0] def self.up add_index :changesets, [:user_id, :created_at], :name => "changesets_user_id_created_at_idx" end diff --git a/db/migrate/20100516124737_add_open_id.rb b/db/migrate/20100516124737_add_open_id.rb index bbe54430d..74d86440c 100644 --- a/db/migrate/20100516124737_add_open_id.rb +++ b/db/migrate/20100516124737_add_open_id.rb @@ -1,4 +1,4 @@ -class AddOpenId < ActiveRecord::Migration +class AddOpenId < ActiveRecord::Migration[5.0] def self.up add_column :users, :openid_url, :string add_index :users, [:openid_url], :name => "user_openid_url_idx", :unique => true diff --git a/db/migrate/20100910084426_add_callback_to_oauth_tokens.rb b/db/migrate/20100910084426_add_callback_to_oauth_tokens.rb index 179b80fab..5db1201fd 100644 --- a/db/migrate/20100910084426_add_callback_to_oauth_tokens.rb +++ b/db/migrate/20100910084426_add_callback_to_oauth_tokens.rb @@ -1,4 +1,4 @@ -class AddCallbackToOauthTokens < ActiveRecord::Migration +class AddCallbackToOauthTokens < ActiveRecord::Migration[5.0] def self.up add_column :oauth_tokens, :callback_url, :string add_column :oauth_tokens, :verifier, :string, :limit => 20 diff --git a/db/migrate/20101114011429_add_editor_preference_to_user.rb b/db/migrate/20101114011429_add_editor_preference_to_user.rb index 7d39cd200..b7f82e325 100644 --- a/db/migrate/20101114011429_add_editor_preference_to_user.rb +++ b/db/migrate/20101114011429_add_editor_preference_to_user.rb @@ -1,4 +1,4 @@ -class AddEditorPreferenceToUser < ActiveRecord::Migration +class AddEditorPreferenceToUser < ActiveRecord::Migration[5.0] def self.up add_column :users, :preferred_editor, :string end diff --git a/db/migrate/20110322001319_add_terms_seen_to_user.rb b/db/migrate/20110322001319_add_terms_seen_to_user.rb index 3cab89652..a95f15b4e 100644 --- a/db/migrate/20110322001319_add_terms_seen_to_user.rb +++ b/db/migrate/20110322001319_add_terms_seen_to_user.rb @@ -1,4 +1,4 @@ -class AddTermsSeenToUser < ActiveRecord::Migration +class AddTermsSeenToUser < ActiveRecord::Migration[5.0] def self.up add_column :users, :terms_seen, :boolean, :null => false, :default => false diff --git a/db/migrate/20110508145337_cleanup_bug_tables.rb b/db/migrate/20110508145337_cleanup_bug_tables.rb index e7dfcb793..2a285b453 100644 --- a/db/migrate/20110508145337_cleanup_bug_tables.rb +++ b/db/migrate/20110508145337_cleanup_bug_tables.rb @@ -1,4 +1,4 @@ -class CleanupBugTables < ActiveRecord::Migration +class CleanupBugTables < ActiveRecord::Migration[5.0] def self.up rename_column :map_bugs, :date_created, :created_at rename_column :map_bugs, :last_changed, :updated_at diff --git a/db/migrate/20110521142405_rename_bugs_to_notes.rb b/db/migrate/20110521142405_rename_bugs_to_notes.rb index 44ca1f484..a22041a29 100644 --- a/db/migrate/20110521142405_rename_bugs_to_notes.rb +++ b/db/migrate/20110521142405_rename_bugs_to_notes.rb @@ -1,6 +1,6 @@ require "migrate" -class RenameBugsToNotes < ActiveRecord::Migration +class RenameBugsToNotes < ActiveRecord::Migration[5.0] def self.up rename_enumeration "map_bug_status_enum", "note_status_enum" rename_enumeration "map_bug_event_enum", "note_event_enum" diff --git a/db/migrate/20110925112722_rename_ids.rb b/db/migrate/20110925112722_rename_ids.rb index 9cdbaaa36..7d7aa8f94 100644 --- a/db/migrate/20110925112722_rename_ids.rb +++ b/db/migrate/20110925112722_rename_ids.rb @@ -1,4 +1,4 @@ -class RenameIds < ActiveRecord::Migration +class RenameIds < ActiveRecord::Migration[5.0] def change rename_column :changeset_tags, :id, :changeset_id rename_column :current_node_tags, :id, :node_id diff --git a/db/migrate/20111116184519_update_oauth.rb b/db/migrate/20111116184519_update_oauth.rb index 59ab9c39b..654e79ef3 100644 --- a/db/migrate/20111116184519_update_oauth.rb +++ b/db/migrate/20111116184519_update_oauth.rb @@ -1,4 +1,4 @@ -class UpdateOauth < ActiveRecord::Migration +class UpdateOauth < ActiveRecord::Migration[5.0] def up add_column :oauth_tokens, :scope, :string add_column :oauth_tokens, :valid_to, :timestamp diff --git a/db/migrate/20111212183945_add_lowercase_user_indexes.rb b/db/migrate/20111212183945_add_lowercase_user_indexes.rb index f25175590..7d1a5e9a9 100644 --- a/db/migrate/20111212183945_add_lowercase_user_indexes.rb +++ b/db/migrate/20111212183945_add_lowercase_user_indexes.rb @@ -1,6 +1,6 @@ require "migrate" -class AddLowercaseUserIndexes < ActiveRecord::Migration +class AddLowercaseUserIndexes < ActiveRecord::Migration[5.0] def up add_index :users, [], :columns => "LOWER(display_name)", :name => "users_display_name_lower_idx" add_index :users, [], :columns => "LOWER(email)", :name => "users_email_lower_idx" diff --git a/db/migrate/20120123184321_switch_to_paperclip.rb b/db/migrate/20120123184321_switch_to_paperclip.rb index f46d61bb5..8dfcce4fb 100644 --- a/db/migrate/20120123184321_switch_to_paperclip.rb +++ b/db/migrate/20120123184321_switch_to_paperclip.rb @@ -1,4 +1,4 @@ -class SwitchToPaperclip < ActiveRecord::Migration +class SwitchToPaperclip < ActiveRecord::Migration[5.0] def up rename_column :users, :image, :image_file_name end diff --git a/db/migrate/20120208122334_merge_acl_address_and_mask.rb b/db/migrate/20120208122334_merge_acl_address_and_mask.rb index 9153da1e5..1e67f46dd 100644 --- a/db/migrate/20120208122334_merge_acl_address_and_mask.rb +++ b/db/migrate/20120208122334_merge_acl_address_and_mask.rb @@ -10,7 +10,7 @@ class IPAddr end end -class MergeAclAddressAndMask < ActiveRecord::Migration +class MergeAclAddressAndMask < ActiveRecord::Migration[5.0] def up Acl.find_each do |acl| address = IPAddr.new(acl.address) diff --git a/db/migrate/20120208194454_add_domain_to_acl.rb b/db/migrate/20120208194454_add_domain_to_acl.rb index 43dd82923..5dd1b6957 100644 --- a/db/migrate/20120208194454_add_domain_to_acl.rb +++ b/db/migrate/20120208194454_add_domain_to_acl.rb @@ -1,4 +1,4 @@ -class AddDomainToAcl < ActiveRecord::Migration +class AddDomainToAcl < ActiveRecord::Migration[5.0] def up add_column :acls, :domain, :string change_column :acls, :address, :inet, :null => true diff --git a/db/migrate/20120214210114_add_text_format.rb b/db/migrate/20120214210114_add_text_format.rb index 165524d2c..8e6853188 100644 --- a/db/migrate/20120214210114_add_text_format.rb +++ b/db/migrate/20120214210114_add_text_format.rb @@ -1,6 +1,6 @@ require "migrate" -class AddTextFormat < ActiveRecord::Migration +class AddTextFormat < ActiveRecord::Migration[5.0] def up create_enumeration :format_enum, %w[html markdown text] add_column :users, :description_format, :format_enum, :null => false, :default => "html" diff --git a/db/migrate/20120219161649_add_user_image_fingerprint.rb b/db/migrate/20120219161649_add_user_image_fingerprint.rb index 5c9dd4083..c3dc5c51a 100644 --- a/db/migrate/20120219161649_add_user_image_fingerprint.rb +++ b/db/migrate/20120219161649_add_user_image_fingerprint.rb @@ -1,4 +1,4 @@ -class AddUserImageFingerprint < ActiveRecord::Migration +class AddUserImageFingerprint < ActiveRecord::Migration[5.0] def up add_column :users, :image_fingerprint, :string, :null => true diff --git a/db/migrate/20120318201948_create_redactions.rb b/db/migrate/20120318201948_create_redactions.rb index 8a1cf6bf3..1cdcc8625 100644 --- a/db/migrate/20120318201948_create_redactions.rb +++ b/db/migrate/20120318201948_create_redactions.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateRedactions < ActiveRecord::Migration +class CreateRedactions < ActiveRecord::Migration[5.0] def change create_table :redactions do |t| t.string :title diff --git a/db/migrate/20120328090602_drop_session_table.rb b/db/migrate/20120328090602_drop_session_table.rb index 0ffcb899b..ad0789ae3 100644 --- a/db/migrate/20120328090602_drop_session_table.rb +++ b/db/migrate/20120328090602_drop_session_table.rb @@ -1,6 +1,6 @@ require "migrate" -class DropSessionTable < ActiveRecord::Migration +class DropSessionTable < ActiveRecord::Migration[5.0] def up drop_table "sessions" end diff --git a/db/migrate/20120404205604_add_user_and_description_to_redaction.rb b/db/migrate/20120404205604_add_user_and_description_to_redaction.rb index 5de170ca7..32d188c8f 100644 --- a/db/migrate/20120404205604_add_user_and_description_to_redaction.rb +++ b/db/migrate/20120404205604_add_user_and_description_to_redaction.rb @@ -1,6 +1,6 @@ require "migrate" -class AddUserAndDescriptionToRedaction < ActiveRecord::Migration +class AddUserAndDescriptionToRedaction < ActiveRecord::Migration[5.0] def change add_column :redactions, :user_id, :bigint, :null => false add_column :redactions, :description_format, :format_enum, :null => false, :default => "markdown" diff --git a/db/migrate/20120808231205_add_counter_caches.rb b/db/migrate/20120808231205_add_counter_caches.rb index a26f204da..1dffb8ffd 100644 --- a/db/migrate/20120808231205_add_counter_caches.rb +++ b/db/migrate/20120808231205_add_counter_caches.rb @@ -1,4 +1,4 @@ -class AddCounterCaches < ActiveRecord::Migration +class AddCounterCaches < ActiveRecord::Migration[5.0] def self.up add_column :users, :changesets_count, :integer, :null => false, :default => 0 add_column :users, :traces_count, :integer, :null => false, :default => 0 diff --git a/db/migrate/20121005195010_add_diary_entry_counter_caches.rb b/db/migrate/20121005195010_add_diary_entry_counter_caches.rb index 9c2c72710..1a61ddd41 100644 --- a/db/migrate/20121005195010_add_diary_entry_counter_caches.rb +++ b/db/migrate/20121005195010_add_diary_entry_counter_caches.rb @@ -1,4 +1,4 @@ -class AddDiaryEntryCounterCaches < ActiveRecord::Migration +class AddDiaryEntryCounterCaches < ActiveRecord::Migration[5.0] def self.up add_column :users, :diary_entries_count, :integer, :null => false, :default => 0 diff --git a/db/migrate/20121012044047_add_image_use_gravatar_to_users.rb b/db/migrate/20121012044047_add_image_use_gravatar_to_users.rb index e430d5b3c..532edd2c7 100644 --- a/db/migrate/20121012044047_add_image_use_gravatar_to_users.rb +++ b/db/migrate/20121012044047_add_image_use_gravatar_to_users.rb @@ -1,4 +1,4 @@ -class AddImageUseGravatarToUsers < ActiveRecord::Migration +class AddImageUseGravatarToUsers < ActiveRecord::Migration[5.0] def self.up add_column :users, :image_use_gravatar, :boolean, :null => false, :default => false diff --git a/db/migrate/20121119165817_drop_nearby_place_from_notes.rb b/db/migrate/20121119165817_drop_nearby_place_from_notes.rb index bbef25946..1aaa43fff 100644 --- a/db/migrate/20121119165817_drop_nearby_place_from_notes.rb +++ b/db/migrate/20121119165817_drop_nearby_place_from_notes.rb @@ -1,4 +1,4 @@ -class DropNearbyPlaceFromNotes < ActiveRecord::Migration +class DropNearbyPlaceFromNotes < ActiveRecord::Migration[5.0] def up remove_column :notes, :nearby_place end diff --git a/db/migrate/20121202155309_remove_author_name_from_note_comment.rb b/db/migrate/20121202155309_remove_author_name_from_note_comment.rb index 60d0ab23b..b844d0ca1 100644 --- a/db/migrate/20121202155309_remove_author_name_from_note_comment.rb +++ b/db/migrate/20121202155309_remove_author_name_from_note_comment.rb @@ -1,4 +1,4 @@ -class RemoveAuthorNameFromNoteComment < ActiveRecord::Migration +class RemoveAuthorNameFromNoteComment < ActiveRecord::Migration[5.0] def up remove_column :note_comments, :author_name end diff --git a/db/migrate/20121203124841_change_note_address_to_inet.rb b/db/migrate/20121203124841_change_note_address_to_inet.rb index e4e53e35a..5ba8611cf 100644 --- a/db/migrate/20121203124841_change_note_address_to_inet.rb +++ b/db/migrate/20121203124841_change_note_address_to_inet.rb @@ -1,4 +1,4 @@ -class ChangeNoteAddressToInet < ActiveRecord::Migration +class ChangeNoteAddressToInet < ActiveRecord::Migration[5.0] def up execute "ALTER TABLE note_comments ALTER COLUMN author_ip TYPE inet USING CAST(author_ip AS inet)" end diff --git a/db/migrate/20130328184137_add_write_notes_permission.rb b/db/migrate/20130328184137_add_write_notes_permission.rb index c7da1740f..6db39f49f 100644 --- a/db/migrate/20130328184137_add_write_notes_permission.rb +++ b/db/migrate/20130328184137_add_write_notes_permission.rb @@ -1,4 +1,4 @@ -class AddWriteNotesPermission < ActiveRecord::Migration +class AddWriteNotesPermission < ActiveRecord::Migration[5.0] def up add_column :oauth_tokens, :allow_write_notes, :boolean, :null => false, :default => false add_column :client_applications, :allow_write_notes, :boolean, :null => false, :default => false diff --git a/db/migrate/20131212124700_add_created_at_index_to_note_comments.rb b/db/migrate/20131212124700_add_created_at_index_to_note_comments.rb index 832204734..baee598cb 100644 --- a/db/migrate/20131212124700_add_created_at_index_to_note_comments.rb +++ b/db/migrate/20131212124700_add_created_at_index_to_note_comments.rb @@ -1,4 +1,4 @@ -class AddCreatedAtIndexToNoteComments < ActiveRecord::Migration +class AddCreatedAtIndexToNoteComments < ActiveRecord::Migration[5.0] def change add_index :note_comments, :created_at end diff --git a/db/migrate/20140115192822_add_text_index_to_note_comments.rb b/db/migrate/20140115192822_add_text_index_to_note_comments.rb index fe9134048..cc9736988 100644 --- a/db/migrate/20140115192822_add_text_index_to_note_comments.rb +++ b/db/migrate/20140115192822_add_text_index_to_note_comments.rb @@ -1,6 +1,6 @@ require "migrate" -class AddTextIndexToNoteComments < ActiveRecord::Migration +class AddTextIndexToNoteComments < ActiveRecord::Migration[5.0] def up add_index :note_comments, [], :columns => "to_tsvector('english', body)", :using => "GIN", :name => "index_note_comments_on_body" end diff --git a/db/migrate/20140117185510_drop_countries.rb b/db/migrate/20140117185510_drop_countries.rb index 083319284..1b58c9fc0 100644 --- a/db/migrate/20140117185510_drop_countries.rb +++ b/db/migrate/20140117185510_drop_countries.rb @@ -1,4 +1,4 @@ -class DropCountries < ActiveRecord::Migration +class DropCountries < ActiveRecord::Migration[5.0] def up drop_table :countries end diff --git a/db/migrate/20140210003018_add_user_image_content_type.rb b/db/migrate/20140210003018_add_user_image_content_type.rb index d212931fc..4001ae8fb 100644 --- a/db/migrate/20140210003018_add_user_image_content_type.rb +++ b/db/migrate/20140210003018_add_user_image_content_type.rb @@ -1,4 +1,4 @@ -class AddUserImageContentType < ActiveRecord::Migration +class AddUserImageContentType < ActiveRecord::Migration[5.0] def change add_column :users, :image_content_type, :string end diff --git a/db/migrate/20140507110937_create_changeset_comments.rb b/db/migrate/20140507110937_create_changeset_comments.rb index 0b36fa228..d4475b4d8 100644 --- a/db/migrate/20140507110937_create_changeset_comments.rb +++ b/db/migrate/20140507110937_create_changeset_comments.rb @@ -1,6 +1,6 @@ require "migrate" -class CreateChangesetComments < ActiveRecord::Migration +class CreateChangesetComments < ActiveRecord::Migration[5.0] def change create_table :changeset_comments do |t| t.column :changeset_id, :bigint, :null => false diff --git a/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb b/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb index 4eab95ce7..a5cfabd69 100644 --- a/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb +++ b/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb @@ -1,6 +1,6 @@ require "migrate" -class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration +class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration[5.0] def change create_table :changesets_subscribers, :id => false do |t| t.column :subscriber_id, :bigint, :null => false diff --git a/db/migrate/20150110152606_change_default_formats.rb b/db/migrate/20150110152606_change_default_formats.rb index 84bc2be40..3f18f6ac2 100644 --- a/db/migrate/20150110152606_change_default_formats.rb +++ b/db/migrate/20150110152606_change_default_formats.rb @@ -1,4 +1,4 @@ -class ChangeDefaultFormats < ActiveRecord::Migration +class ChangeDefaultFormats < ActiveRecord::Migration[5.0] def up change_column_default :diary_entries, :body_format, "markdown" change_column_default :diary_comments, :body_format, "markdown" diff --git a/db/migrate/20150111192335_subscribe_old_changesets.rb b/db/migrate/20150111192335_subscribe_old_changesets.rb index cca8293f5..0a722b3a1 100644 --- a/db/migrate/20150111192335_subscribe_old_changesets.rb +++ b/db/migrate/20150111192335_subscribe_old_changesets.rb @@ -1,4 +1,4 @@ -class SubscribeOldChangesets < ActiveRecord::Migration +class SubscribeOldChangesets < ActiveRecord::Migration[5.0] def up Changeset.find_each do |changeset| changeset.subscribers << changeset.user unless changeset.subscribers.exists?(changeset.user.id) diff --git a/db/migrate/20150222101847_rename_openid_url.rb b/db/migrate/20150222101847_rename_openid_url.rb index b0735b746..8d49dc973 100644 --- a/db/migrate/20150222101847_rename_openid_url.rb +++ b/db/migrate/20150222101847_rename_openid_url.rb @@ -1,4 +1,4 @@ -class RenameOpenidUrl < ActiveRecord::Migration +class RenameOpenidUrl < ActiveRecord::Migration[5.0] def change rename_column :users, :openid_url, :auth_uid add_column :users, :auth_provider, :string diff --git a/db/migrate/20150818224516_set_default_gravatar_to_false_for_privacy.rb b/db/migrate/20150818224516_set_default_gravatar_to_false_for_privacy.rb index 49f94c9de..28f3c828d 100644 --- a/db/migrate/20150818224516_set_default_gravatar_to_false_for_privacy.rb +++ b/db/migrate/20150818224516_set_default_gravatar_to_false_for_privacy.rb @@ -1,4 +1,4 @@ -class SetDefaultGravatarToFalseForPrivacy < ActiveRecord::Migration +class SetDefaultGravatarToFalseForPrivacy < ActiveRecord::Migration[5.0] def up change_column :users, :image_use_gravatar, :boolean, :default => false end diff --git a/db/migrate/20161002153425_add_join_table_between_users_and_diary_entries.rb b/db/migrate/20161002153425_add_join_table_between_users_and_diary_entries.rb index cb8e455dd..088b9d28b 100644 --- a/db/migrate/20161002153425_add_join_table_between_users_and_diary_entries.rb +++ b/db/migrate/20161002153425_add_join_table_between_users_and_diary_entries.rb @@ -1,6 +1,6 @@ require "migrate" -class AddJoinTableBetweenUsersAndDiaryEntries < ActiveRecord::Migration +class AddJoinTableBetweenUsersAndDiaryEntries < ActiveRecord::Migration[5.0] def self.up create_table :diary_entry_subscriptions, :id => false do |t| t.column :user_id, :bigint, :null => false diff --git a/db/migrate/20161011010929_subscribe_authors_to_diary_entries.rb b/db/migrate/20161011010929_subscribe_authors_to_diary_entries.rb index 3fcbdf5fb..219386900 100644 --- a/db/migrate/20161011010929_subscribe_authors_to_diary_entries.rb +++ b/db/migrate/20161011010929_subscribe_authors_to_diary_entries.rb @@ -1,4 +1,4 @@ -class SubscribeAuthorsToDiaryEntries < ActiveRecord::Migration +class SubscribeAuthorsToDiaryEntries < ActiveRecord::Migration[5.0] def up DiaryEntry.find_each do |diary_entry| diary_entry.subscriptions.create(:user => diary_entry.user) unless diary_entry.subscribers.exists?(diary_entry.user.id) diff --git a/db/migrate/20170222134109_add_user_indexes.rb b/db/migrate/20170222134109_add_user_indexes.rb index 62330df9c..b138039ea 100644 --- a/db/migrate/20170222134109_add_user_indexes.rb +++ b/db/migrate/20170222134109_add_user_indexes.rb @@ -1,4 +1,4 @@ -class AddUserIndexes < ActiveRecord::Migration +class AddUserIndexes < ActiveRecord::Migration[5.0] def change add_index :oauth_tokens, [:user_id] add_index :client_applications, [:user_id]