Merge remote-tracking branch 'upstream/pull/1652'
This commit is contained in:
commit
38640e0253
103 changed files with 172 additions and 153 deletions
4
Gemfile
4
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"
|
||||
|
|
98
Gemfile.lock
98
Gemfile.lock
|
@ -2,41 +2,41 @@ 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)
|
||||
|
@ -46,15 +46,15 @@ GEM
|
|||
annotate (2.7.2)
|
||||
activerecord (>= 3.2, < 6.0)
|
||||
rake (>= 10.4, < 13.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)
|
||||
|
@ -72,8 +72,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)
|
||||
|
@ -87,7 +87,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)
|
||||
|
@ -102,7 +102,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)
|
||||
|
@ -225,7 +225,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)
|
||||
|
@ -234,20 +234,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)
|
||||
|
@ -261,9 +261,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)
|
||||
|
@ -338,7 +338,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
|
||||
|
@ -359,7 +359,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
|
||||
|
@ -395,7 +395,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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Load the Rails application.
|
||||
require File.expand_path("../application", __FILE__)
|
||||
require_relative "application"
|
||||
|
||||
# Initialize the Rails application.
|
||||
Rails.application.initialize!
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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?
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserImage < ActiveRecord::Migration
|
||||
class AddUserImage < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column "users", "image", :text
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddNewEmail < ActiveRecord::Migration
|
||||
class AddNewEmail < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column "users", "new_email", :string
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddCreationIp < ActiveRecord::Migration
|
||||
class AddCreationIp < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column "users", "creation_ip", :string
|
||||
end
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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?
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserLocale < ActiveRecord::Migration
|
||||
class AddUserLocale < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column "users", "locale", :string
|
||||
end
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddRefererToUserToken < ActiveRecord::Migration
|
||||
class AddRefererToUserToken < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column :user_tokens, :referer, :text
|
||||
end
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddEditorPreferenceToUser < ActiveRecord::Migration
|
||||
class AddEditorPreferenceToUser < ActiveRecord::Migration[5.0]
|
||||
def self.up
|
||||
add_column :users, :preferred_editor, :string
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class SwitchToPaperclip < ActiveRecord::Migration
|
||||
class SwitchToPaperclip < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
rename_column :users, :image, :image_file_name
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserImageFingerprint < ActiveRecord::Migration
|
||||
class AddUserImageFingerprint < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
add_column :users, :image_fingerprint, :string, :null => true
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require "migrate"
|
||||
|
||||
class DropSessionTable < ActiveRecord::Migration
|
||||
class DropSessionTable < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
drop_table "sessions"
|
||||
end
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class DropNearbyPlaceFromNotes < ActiveRecord::Migration
|
||||
class DropNearbyPlaceFromNotes < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
remove_column :notes, :nearby_place
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveAuthorNameFromNoteComment < ActiveRecord::Migration
|
||||
class RemoveAuthorNameFromNoteComment < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
remove_column :note_comments, :author_name
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddCreatedAtIndexToNoteComments < ActiveRecord::Migration
|
||||
class AddCreatedAtIndexToNoteComments < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_index :note_comments, :created_at
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class DropCountries < ActiveRecord::Migration
|
||||
class DropCountries < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
drop_table :countries
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserImageContentType < ActiveRecord::Migration
|
||||
class AddUserImageContentType < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_column :users, :image_content_type, :string
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue