From e0a7e0fec760ba12c8067a37e10c96f1f05876e2 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 24 Jun 2026 04:13:16 +0200 Subject: Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade - Converted plugins to gems (Gemfile) - Updated config structure (application.rb, boot.rb, environment.rb) - Converted routes to Rails 3 DSL - Converted named_scope to scope throughout models - Converted find(:all, :conditions) to where() chains - Fixed has_many :order to use ordering scope - Updated session store and secret token configuration - Fixed exception_notification middleware configuration - Patched Ruby 2.4 / Rails 3.2 incompatibilities: - Integer/Float duration arithmetic (ActiveSupport) - Arel visit_Integer for PostgreSQL adapter - create_database String/Integer coercion - ActionController consider_all_requests_local - Migrated taggings schema for acts-as-taggable-on - Replaced dynamic_form gem with custom form_error_messages helper - Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for) - Fixed admin layout yield - Updated test suite for Rails 3 APIs --- ...232228_upgrade_taggings_for_acts_as_taggable_on.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb (limited to 'db') diff --git a/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb b/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb new file mode 100644 index 0000000..5051239 --- /dev/null +++ b/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb @@ -0,0 +1,19 @@ +class UpgradeTaggingsForActsAsTaggableOn < ActiveRecord::Migration + def up + add_column :taggings, :context, :string + add_column :taggings, :tagger_id, :integer + add_column :taggings, :tagger_type, :string + + # populate context for existing taggings + execute "UPDATE taggings SET context = 'tags'" + + add_index :taggings, :context + add_index :taggings, [:tagger_id, :tagger_type] + end + + def down + remove_column :taggings, :context + remove_column :taggings, :tagger_id + remove_column :taggings, :tagger_type + end +end -- cgit v1.3 From 61dc69cc5d8089ed9f96bc65dc64de6e075f70cf Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 24 Jun 2026 16:16:57 +0200 Subject: Upgrade acts-as-taggable-on to 3.5, add Rails 3.2 config fixes - Bump acts-as-taggable-on from 2.4.1 to 3.5.0 - Fake engine migrations for pre-existing schema - Set serve_static_assets in development - Fix request.fullpath in authenticated_system (request_uri removed in Rails 3.x) - Fix Paperclip path format to match existing file layout --- Gemfile | 4 +-- Gemfile.lock | 8 +++--- bin/rails | 29 ++++++++++++++++++++ config.ru | 4 +++ config/application.rb | 1 + config/environments/development.rb | 1 + ...able_on_migration.acts_as_taggable_on_engine.rb | 31 ++++++++++++++++++++++ ...ng_unique_indices.acts_as_taggable_on_engine.rb | 20 ++++++++++++++ ...ter_cache_to_tags.acts_as_taggable_on_engine.rb | 15 +++++++++++ ...ng_taggable_index.acts_as_taggable_on_engine.rb | 10 +++++++ ...ion_for_tag_names.acts_as_taggable_on_engine.rb | 10 +++++++ 11 files changed, 127 insertions(+), 6 deletions(-) create mode 100755 bin/rails create mode 100644 config.ru create mode 100644 db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb create mode 100644 db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb create mode 100644 db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb create mode 100644 db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb create mode 100644 db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb (limited to 'db') diff --git a/Gemfile b/Gemfile index 9a803c9..594f94e 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'rails', '3.2.22.5' gem 'pg', '~> 0.17.0' # from your vendor/plugins, now as gems: -gem 'acts-as-taggable-on', '~> 2.4' +gem 'acts-as-taggable-on', '~> 3.5' gem 'awesome_nested_set', '~> 2.1' gem 'acts_as_list' gem 'globalize3', '~> 0.3.0' @@ -25,7 +25,7 @@ group :assets do end group :test do - gem 'test-unit', '~> 3.0' + gem 'test-unit', '~> 3.5' end gem 'chaos_calendar', :git => 'https://github.com/erdgeist/chaoscalendar.git', :require => 'chaos_calendar', :branch => 'erdgeist-ruby1.9' diff --git a/Gemfile.lock b/Gemfile.lock index 84425ea..34e0133 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,8 +35,8 @@ GEM activesupport (3.2.22.5) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - acts-as-taggable-on (2.4.1) - rails (>= 3, < 5) + acts-as-taggable-on (3.5.0) + activerecord (>= 3.2, < 5) acts_as_list (0.9.19) activerecord (>= 3.0) arel (3.0.3) @@ -148,7 +148,7 @@ PLATFORMS ruby DEPENDENCIES - acts-as-taggable-on (~> 2.4) + acts-as-taggable-on (~> 3.5) acts_as_list awesome_nested_set (~> 2.1) chaos_calendar! @@ -161,7 +161,7 @@ DEPENDENCIES rails (= 3.2.22.5) routing-filter (~> 0.3) sass-rails (~> 3.2.3) - test-unit (~> 3.0) + test-unit (~> 3.5) uglifier (>= 1.0.3) unicorn (~> 1.1) will_paginate (~> 3.0) diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..7fd59cc --- /dev/null +++ b/bin/rails @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rails' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("railties", "rails") diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..64c7ad9 --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Cccms::Application diff --git a/config/application.rb b/config/application.rb index 9b7ae67..cb92166 100644 --- a/config/application.rb +++ b/config/application.rb @@ -56,5 +56,6 @@ module Cccms config.i18n.default_locale = :de config.filter_parameters += [:password, :password_confirmation] + config.serve_static_assets = true end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 6446686..94f216f 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -17,4 +17,5 @@ Cccms::Application.configure do config.action_mailer.raise_delivery_errors = false config.active_support.deprecation = :log + config.serve_static_assets = true end diff --git a/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..6bbd559 --- /dev/null +++ b/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb @@ -0,0 +1,31 @@ +# This migration comes from acts_as_taggable_on_engine (originally 1) +class ActsAsTaggableOnMigration < ActiveRecord::Migration + def self.up + create_table :tags do |t| + t.string :name + end + + create_table :taggings do |t| + t.references :tag + + # You should make sure that the column created is + # long enough to store the required class names. + t.references :taggable, polymorphic: true + t.references :tagger, polymorphic: true + + # Limit is created to prevent MySQL error on index + # length for MyISAM table type: http://bit.ly/vgW2Ql + t.string :context, limit: 128 + + t.datetime :created_at + end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + drop_table :taggings + drop_table :tags + end +end diff --git a/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..4ca676f --- /dev/null +++ b/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb @@ -0,0 +1,20 @@ +# This migration comes from acts_as_taggable_on_engine (originally 2) +class AddMissingUniqueIndices < ActiveRecord::Migration + def self.up + add_index :tags, :name, unique: true + + remove_index :taggings, :tag_id + remove_index :taggings, [:taggable_id, :taggable_type, :context] + add_index :taggings, + [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], + unique: true, name: 'taggings_idx' + end + + def self.down + remove_index :tags, :name + + remove_index :taggings, name: 'taggings_idx' + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end +end diff --git a/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..8edb508 --- /dev/null +++ b/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb @@ -0,0 +1,15 @@ +# This migration comes from acts_as_taggable_on_engine (originally 3) +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration + def self.up + add_column :tags, :taggings_count, :integer, default: 0 + + ActsAsTaggableOn::Tag.reset_column_information + ActsAsTaggableOn::Tag.find_each do |tag| + ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) + end + end + + def self.down + remove_column :tags, :taggings_count + end +end diff --git a/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..71f2d7f --- /dev/null +++ b/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 4) +class AddMissingTaggableIndex < ActiveRecord::Migration + def self.up + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + remove_index :taggings, [:taggable_id, :taggable_type, :context] + end +end diff --git a/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..bfb06bc --- /dev/null +++ b/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 5) +# This migration is added to circumvent issue #623 and have special characters +# work properly +class ChangeCollationForTagNames < ActiveRecord::Migration + def up + if ActsAsTaggableOn::Utils.using_mysql? + execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") + end + end +end -- cgit v1.3 From 7f26a8202556db3a584f1360950a671d2a60a1ea Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 25 Jun 2026 17:49:34 +0200 Subject: Upgrade to Rails 5.2.8.1 on Ruby 2.5.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump rails 4.2.11.3 → 5.2.8.1, ruby 2.4.10 → 2.5.8 - Upgrade acts-as-taggable-on ~> 3.5 → ~> 6.0 - Upgrade exception_notification ~> 4.4 → ~> 4.5 - Upgrade globalize ~> 5.0 → ~> 5.2.0 - Upgrade pg ~> 0.17 → ~> 1.0 - Upgrade sass-rails ~> 4.0 → ~> 5.0 - Upgrade libxml-ruby to ~> 3.2 (5.x requires Ruby 3.2+) - Pin awesome_nested_set ~> 3.4.0 (3.9 has lft/rgt update bug) - Add rails-controller-testing gem - Add assets initializer for jquery precompile - Add acts_as_taggable missing indexes migration - Set eager_load, serve_static_files, active_record settings --- .bundle/config | 2 + .ruby-gemset | 2 +- .ruby-version | 2 +- Gemfile | 17 +- Gemfile.lock | 246 ++++++++++++--------- config/environments/test.rb | 3 +- config/initializers/assets.rb | 1 + ...dexes_on_taggings.acts_as_taggable_on_engine.rb | 23 ++ 8 files changed, 185 insertions(+), 111 deletions(-) create mode 100644 .bundle/config create mode 100644 config/initializers/assets.rb create mode 100644 db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb (limited to 'db') diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..71be015 --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_BUNDLER_VERSION: "2.3.27" diff --git a/.ruby-gemset b/.ruby-gemset index c100f88..48fed33 100644 --- a/.ruby-gemset +++ b/.ruby-gemset @@ -1 +1 @@ -rails3-upgrade +rails5-upgrade diff --git a/.ruby-version b/.ruby-version index 5304f06..56b1397 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.4.10 +ruby-2.5.8 diff --git a/Gemfile b/Gemfile index f00395b..b43b986 100644 --- a/Gemfile +++ b/Gemfile @@ -1,18 +1,18 @@ source 'https://rubygems.org' -gem 'rails', '4.2.11.3' +gem 'rails', '5.2.8.1' -gem 'pg', '~> 0.17.0' +gem 'pg', '~> 1.0' -gem 'acts-as-taggable-on', '~> 3.5' -gem 'awesome_nested_set', '~> 3.1' +gem 'acts-as-taggable-on', '~> 6.0' +gem 'awesome_nested_set', '~> 3.4.0' gem 'acts_as_list' -gem 'globalize', '~> 5.0' +gem 'globalize', '~> 5.2.0' gem 'routing-filter', '~> 0.6' gem 'paperclip', '~> 3.5' gem 'will_paginate', '~> 3.0' -gem 'exception_notification' -gem 'libxml-ruby', :require => 'xml' +gem 'exception_notification', '~> 4.5' +gem 'libxml-ruby', '~> 3.2', :require => 'xml' gem 'nokogiri', '~> 1.10.10' gem 'loofah', '~> 2.20.0' @@ -22,13 +22,14 @@ gem 'jquery-rails' gem 'unicorn', '~> 1.1' group :assets do - gem 'sass-rails', '~> 4.0' + gem 'sass-rails', '~> 5.0' gem 'coffee-rails', '~> 4.0' gem 'uglifier', '>= 1.0.3' end group :test do gem 'test-unit', '~> 3.5' + gem 'rails-controller-testing' end gem 'chaos_calendar', :git => 'https://github.com/erdgeist/chaoscalendar.git', diff --git a/Gemfile.lock b/Gemfile.lock index 6350f67..74b71e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/erdgeist/chaoscalendar.git - revision: a1a84e0a1b05f2b64ea7fefb5fa159fccf43abce + revision: 0a46bdf537e691f06e8e486e035866682f77f511 branch: erdgeist-ruby1.9 specs: chaos_calendar (0.1.3) @@ -8,47 +8,55 @@ GIT GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) + actioncable (5.2.8.1) + actionpack (= 5.2.8.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.11.3) - actionview (= 4.2.11.3) - activesupport (= 4.2.11.3) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.2.8.1) + actionview (= 5.2.8.1) + activesupport (= 5.2.8.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.3) - activesupport (= 4.2.11.3) + actionview (5.2.8.1) + activesupport (= 5.2.8.1) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.11.3) - activesupport (= 4.2.11.3) - globalid (>= 0.3.0) - activemodel (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - activerecord (4.2.11.3) - activemodel (= 4.2.11.3) - activesupport (= 4.2.11.3) - arel (~> 6.0) - activesupport (4.2.11.3) - i18n (~> 0.7) + activejob (5.2.8.1) + activesupport (= 5.2.8.1) + globalid (>= 0.3.6) + activemodel (5.2.8.1) + activesupport (= 5.2.8.1) + activerecord (5.2.8.1) + activemodel (= 5.2.8.1) + activesupport (= 5.2.8.1) + arel (>= 9.0) + activestorage (5.2.8.1) + actionpack (= 5.2.8.1) + activerecord (= 5.2.8.1) + marcel (~> 1.0.0) + activesupport (5.2.8.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - acts-as-taggable-on (3.5.0) - activerecord (>= 3.2, < 5) + acts-as-taggable-on (6.5.0) + activerecord (>= 5.0, < 6.1) acts_as_list (1.1.0) activerecord (>= 4.2) - arel (6.0.4) - awesome_nested_set (3.9.0) - activerecord (>= 4.0.0, < 8.2) + arel (9.0.0) + awesome_nested_set (3.4.0) + activerecord (>= 4.0.0, < 7.0) + base64 (0.3.0) builder (3.3.0) climate_control (0.2.0) cocaine (0.5.8) @@ -62,31 +70,39 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.3.7) crass (1.0.6) - erubis (2.7.0) - exception_notification (4.4.3) - actionmailer (>= 4.0, < 7) - activesupport (>= 4.0, < 7) - execjs (2.9.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - globalize (5.3.1) - activemodel (>= 4.2, < 6.1) - activerecord (>= 4.2, < 6.1) + digest (3.2.1) + erubi (1.13.1) + exception_notification (4.6.0) + actionmailer (>= 5.2, < 9) + activesupport (>= 5.2, < 9) + execjs (2.10.1) + ffi (1.17.4) + globalid (1.1.0) + activesupport (>= 5.0) + globalize (5.2.0) + activemodel (>= 4.2, < 5.3) + activerecord (>= 4.2, < 5.3) request_store (~> 1.0) - hike (1.2.3) - i18n (0.9.5) + i18n (1.14.8) concurrent-ruby (~> 1.0) + io-wait (0.3.1) jquery-rails (4.6.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - libxml-ruby (3.1.0) - logger (1.5.3) + libxml-ruby (3.2.4) + logger (1.7.0) loofah (2.20.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + method_source (1.1.0) mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) @@ -94,7 +110,20 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - multi_json (1.15.0) + net-imap (0.2.2) + digest + net-protocol + strscan + net-pop (0.1.2) + net-protocol + net-protocol (0.1.2) + io-wait + timeout + net-smtp (0.3.0) + digest + net-protocol + timeout + nio4r (2.7.3) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) paperclip (3.5.4) @@ -102,94 +131,113 @@ GEM activesupport (>= 3.0.0) cocaine (~> 0.5.3) mime-types - pg (0.17.1) + pg (1.5.9) power_assert (3.0.1) - rack (1.6.13) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.11.3) - actionmailer (= 4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) - activemodel (= 4.2.11.3) - activerecord (= 4.2.11.3) - activesupport (= 4.2.11.3) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.11.3) - sprockets-rails - rails-deprecated_sanitizer (1.0.4) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rack (2.2.23) + rack-test (2.2.0) + rack (>= 1.3) + rails (5.2.8.1) + actioncable (= 5.2.8.1) + actionmailer (= 5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) + activemodel (= 5.2.8.1) + activerecord (= 5.2.8.1) + activestorage (= 5.2.8.1) + activesupport (= 5.2.8.1) + bundler (>= 1.3.0) + railties (= 5.2.8.1) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) rails-html-sanitizer (1.4.4) loofah (~> 2.19, >= 2.19.1) - railties (4.2.11.3) - actionpack (= 4.2.11.3) - activesupport (= 4.2.11.3) + railties (5.2.8.1) + actionpack (= 5.2.8.1) + activesupport (= 5.2.8.1) + method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + thor (>= 0.19.0, < 2.0) rake (13.4.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) request_store (1.7.0) rack (>= 1.4) routing-filter (0.6.3) actionpack (>= 4.2) activesupport (>= 4.2) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sprockets (2.12.5) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.1.0) + railties (>= 5.2.0) + sass (~> 3.1) sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sprockets (3.7.5) + base64 + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + strscan (3.1.8) test-unit (3.7.8) power_assert thor (1.2.2) thread_safe (0.3.6) - tilt (1.4.1) + tilt (2.7.0) + timeout (0.4.0) tzinfo (1.2.11) thread_safe (~> 0.1) uglifier (4.2.1) execjs (>= 0.3.0, < 3) unicorn (1.1.7) rack + websocket-driver (0.8.2) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) will_paginate (3.3.1) PLATFORMS ruby DEPENDENCIES - acts-as-taggable-on (~> 3.5) + acts-as-taggable-on (~> 6.0) acts_as_list - awesome_nested_set (~> 3.1) + awesome_nested_set (~> 3.4.0) chaos_calendar! coffee-rails (~> 4.0) - exception_notification - globalize (~> 5.0) + exception_notification (~> 4.5) + globalize (~> 5.2.0) jquery-rails - libxml-ruby + libxml-ruby (~> 3.2) loofah (~> 2.20.0) nokogiri (~> 1.10.10) paperclip (~> 3.5) - pg (~> 0.17.0) - rails (= 4.2.11.3) + pg (~> 1.0) + rails (= 5.2.8.1) + rails-controller-testing rails-html-sanitizer (~> 1.4.4) routing-filter (~> 0.6) - sass-rails (~> 4.0) + sass-rails (~> 5.0) test-unit (~> 3.5) uglifier (>= 1.0.3) unicorn (~> 1.1) will_paginate (~> 3.0) BUNDLED WITH - 1.17.3 + 2.3.27 diff --git a/config/environments/test.rb b/config/environments/test.rb index 3b2413e..858bebb 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -15,9 +15,8 @@ Cccms::Application.configure do config.active_support.deprecation = :log config.active_support.test_order = :sorted - config.active_record.raise_in_transactional_callbacks = true - config.eager_load = false config.serve_static_files = true config.static_cache_control = "public, max-age=3600" + config.assets.compile = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..938e89d --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1 @@ +Rails.application.config.assets.precompile += %w( jquery.js jquery_ujs.js ) diff --git a/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb b/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..7c39589 --- /dev/null +++ b/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb @@ -0,0 +1,23 @@ +# This migration comes from acts_as_taggable_on_engine (originally 6) +if ActiveRecord.gem_version >= Gem::Version.new('5.0') + class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end +else + class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end +end +AddMissingIndexesOnTaggings.class_eval do + def change + add_index ActsAsTaggableOn.taggings_table, :tag_id unless index_exists? ActsAsTaggableOn.taggings_table, :tag_id + add_index ActsAsTaggableOn.taggings_table, :taggable_id unless index_exists? ActsAsTaggableOn.taggings_table, :taggable_id + add_index ActsAsTaggableOn.taggings_table, :taggable_type unless index_exists? ActsAsTaggableOn.taggings_table, :taggable_type + add_index ActsAsTaggableOn.taggings_table, :tagger_id unless index_exists? ActsAsTaggableOn.taggings_table, :tagger_id + add_index ActsAsTaggableOn.taggings_table, :context unless index_exists? ActsAsTaggableOn.taggings_table, :context + + unless index_exists? ActsAsTaggableOn.taggings_table, [:tagger_id, :tagger_type] + add_index ActsAsTaggableOn.taggings_table, [:tagger_id, :tagger_type] + end + + unless index_exists? ActsAsTaggableOn.taggings_table, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy' + add_index ActsAsTaggableOn.taggings_table, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy' + end + end +end -- cgit v1.3 From c2b3f184df4a60a872eea77971cd83ea6d8297b0 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 26 Jun 2026 22:11:52 +0200 Subject: Enable full-text search via PostgreSQL tsvector on page_translations - Restore search vector migration (was parked in doc/ pending PostgreSQL upgrade) - Restore Node.search using plainto_tsquery with simple dictionary - Cross-locale keyword search, no stemming, works for both de and en content --- app/models/node.rb | 10 +++-- ...25705_add_search_vector_to_page_translations.rb | 47 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20260626025705_add_search_vector_to_page_translations.rb (limited to 'db') diff --git a/app/models/node.rb b/app/models/node.rb index 41c3867..a3ef23a 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -211,11 +211,13 @@ class Node < ApplicationRecord self.created_at < new_id_format_date ? unique_path : id end - # TODO: restore full-text search once PostgreSQL is upgraded. - # The tsvector/plpgsql approach requires PostgreSQL 10+ with plpgsql available. - # For now, search is disabled to unblock the Rails 7.2 upgrade. + # Full-text search across all locale translations using PostgreSQL tsvector. + # Uses 'simple' dictionary (no stemming, no stopwords) so queries work + # across German and English content without language detection. def self.search(term, _ = {}) - none + joins(head: :translations) + .where("page_translations.search_vector @@ plainto_tsquery('simple', ?)", term) + .distinct end protected diff --git a/db/migrate/20260626025705_add_search_vector_to_page_translations.rb b/db/migrate/20260626025705_add_search_vector_to_page_translations.rb new file mode 100644 index 0000000..0747637 --- /dev/null +++ b/db/migrate/20260626025705_add_search_vector_to_page_translations.rb @@ -0,0 +1,47 @@ +class AddSearchVectorToPageTranslations < ActiveRecord::Migration[7.2] + def up + add_column :page_translations, :search_vector, :tsvector + + execute <<~SQL + UPDATE page_translations + SET search_vector = to_tsvector( + 'simple', + coalesce(title, '') || ' ' || + coalesce(abstract, '') || ' ' || + coalesce(body, '') + ) + SQL + + add_index :page_translations, :search_vector, + using: :gin, + name: 'index_page_translations_on_search_vector' + + execute <<~SQL + CREATE OR REPLACE FUNCTION page_translations_search_vector_update() + RETURNS trigger AS $$ + BEGIN + NEW.search_vector := to_tsvector( + 'simple', + coalesce(NEW.title, '') || ' ' || + coalesce(NEW.abstract, '') || ' ' || + coalesce(NEW.body, '') + ); + RETURN NEW; + END; + $$ LANGUAGE plpgsql; + + CREATE TRIGGER page_translations_search_vector_trigger + BEFORE INSERT OR UPDATE ON page_translations + FOR EACH ROW EXECUTE PROCEDURE page_translations_search_vector_update(); + SQL + end + + def down + execute <<~SQL + DROP TRIGGER IF EXISTS page_translations_search_vector_trigger ON page_translations; + DROP FUNCTION IF EXISTS page_translations_search_vector_update(); + SQL + remove_index :page_translations, name: 'index_page_translations_on_search_vector' + remove_column :page_translations, :search_vector + end +end -- cgit v1.3 From e7d5d0b2c32b172ecdaa80555bf5804043fd87a0 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 27 Jun 2026 00:32:17 +0200 Subject: Fix I18n::InvalidLocale :root errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix Page.find(self.head) → self.head in node.rb wipe_draft! - Migration to delete 407 spurious 'root' locale records from page_translations (Globalize artefact, all had nil titles and duplicate de/en translations existed for all affected pages) --- app/models/node.rb | 2 +- ...20260626222953_remove_root_locale_from_page_translations.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20260626222953_remove_root_locale_from_page_translations.rb (limited to 'db') diff --git a/app/models/node.rb b/app/models/node.rb index a3ef23a..59a9d7c 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -137,7 +137,7 @@ class Node < ApplicationRecord end return unless self.head return unless self.draft.updated_at < 1.day.ago - return if Page.find(self.head).has_changes_to? self.draft + return if self.head.has_changes_to? self.draft self.draft.destroy self.draft_id = nil diff --git a/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb b/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb new file mode 100644 index 0000000..51fcfbc --- /dev/null +++ b/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb @@ -0,0 +1,10 @@ +class RemoveRootLocaleFromPageTranslations < ActiveRecord::Migration[7.2] + def up + count = execute("DELETE FROM page_translations WHERE locale = 'root'").cmd_tuples + say "Deleted #{count} root locale records from page_translations" + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end -- cgit v1.3 From 241d5e91b2b6716e2861cc77d319c3d3568343a8 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 27 Jun 2026 04:23:37 +0200 Subject: Fix unversioned migrations --- db/migrate/20090129204750_create_nodes.rb | 2 +- .../20090129205013_add_missing_columns_for_nested_set_for_node.rb | 2 +- db/migrate/20090131113802_create_pages.rb | 2 +- db/migrate/20090131213536_add_published_at_to_pages.rb | 2 +- db/migrate/20090201211523_add_join_table_for_flags_pages.rb | 2 +- db/migrate/20090206201554_add_head_id_to_node.rb | 2 +- db/migrate/20090208130829_create_users.rb | 2 +- db/migrate/20090208130906_add_user_id_to_pages.rb | 2 +- db/migrate/20090211220524_create_permissions.rb | 2 +- db/migrate/20090301104237_add_draft_id_to_nodes.rb | 2 +- db/migrate/20090302184350_add_template_column_to_pages.rb | 2 +- db/migrate/20090302215335_rename_template_to_template_name.rb | 2 +- db/migrate/20090316194152_create_events.rb | 2 +- db/migrate/20090316195143_create_occurrences.rb | 2 +- db/migrate/20090318203913_add_location_to_event.rb | 2 +- db/migrate/20090318212438_remove_summary_column_from_occurrences.rb | 2 +- db/migrate/20090321150359_add_locking_user_id_to_nodes.rb | 2 +- db/migrate/20090401190026_add_full_name_to_users.rb | 2 +- db/migrate/20090424085851_create_assets.rb | 2 +- db/migrate/20090719180204_create_menu_items.rb | 2 +- db/migrate/20090809104800_add_position_to_menu_items.rb | 2 +- db/migrate/20090815220058_migrate_tagging_tables.rb | 2 +- db/migrate/20090901051946_create_related_assets.rb | 2 +- db/migrate/20090901095657_add_indices.rb | 2 +- db/migrate/20090907103525_add_type_column_to_menu_items.rb | 2 +- db/migrate/20090907111533_add_type_id_to_menu_items.rb | 2 +- db/migrate/20090909113832_add_staged_slug_and_parent_id.rb | 2 +- db/migrate/20090917180422_add_admin_flag_to_user.rb | 2 +- db/migrate/20091111154113_add_editor_id_to_pages.rb | 2 +- db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb | 2 +- ...24035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb | 2 +- ...60624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb | 2 +- ...151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb | 2 +- ...60624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb | 2 +- ...4035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) (limited to 'db') diff --git a/db/migrate/20090129204750_create_nodes.rb b/db/migrate/20090129204750_create_nodes.rb index e7cd562..e26dd39 100644 --- a/db/migrate/20090129204750_create_nodes.rb +++ b/db/migrate/20090129204750_create_nodes.rb @@ -1,4 +1,4 @@ -class CreateNodes < ActiveRecord::Migration +class CreateNodes < ActiveRecord::Migration[4.2] def self.up create_table :nodes do |t| t.string :slug diff --git a/db/migrate/20090129205013_add_missing_columns_for_nested_set_for_node.rb b/db/migrate/20090129205013_add_missing_columns_for_nested_set_for_node.rb index f8f8404..2aa4241 100644 --- a/db/migrate/20090129205013_add_missing_columns_for_nested_set_for_node.rb +++ b/db/migrate/20090129205013_add_missing_columns_for_nested_set_for_node.rb @@ -1,4 +1,4 @@ -class AddMissingColumnsForNestedSetForNode < ActiveRecord::Migration +class AddMissingColumnsForNestedSetForNode < ActiveRecord::Migration[4.2] def self.up add_column :nodes, :lft, :integer add_column :nodes, :rgt, :integer diff --git a/db/migrate/20090131113802_create_pages.rb b/db/migrate/20090131113802_create_pages.rb index 6a38038..bba9cad 100644 --- a/db/migrate/20090131113802_create_pages.rb +++ b/db/migrate/20090131113802_create_pages.rb @@ -1,4 +1,4 @@ -class CreatePages < ActiveRecord::Migration +class CreatePages < ActiveRecord::Migration[4.2] def self.up create_table :pages do |t| t.integer :node_id diff --git a/db/migrate/20090131213536_add_published_at_to_pages.rb b/db/migrate/20090131213536_add_published_at_to_pages.rb index 0e4ee62..1a57deb 100644 --- a/db/migrate/20090131213536_add_published_at_to_pages.rb +++ b/db/migrate/20090131213536_add_published_at_to_pages.rb @@ -1,4 +1,4 @@ -class AddPublishedAtToPages < ActiveRecord::Migration +class AddPublishedAtToPages < ActiveRecord::Migration[4.2] def self.up add_column :pages, :published_at, :datetime end diff --git a/db/migrate/20090201211523_add_join_table_for_flags_pages.rb b/db/migrate/20090201211523_add_join_table_for_flags_pages.rb index 99eb9c9..cda4af4b 100644 --- a/db/migrate/20090201211523_add_join_table_for_flags_pages.rb +++ b/db/migrate/20090201211523_add_join_table_for_flags_pages.rb @@ -1,4 +1,4 @@ -class AddJoinTableForFlagsPages < ActiveRecord::Migration +class AddJoinTableForFlagsPages < ActiveRecord::Migration[4.2] def self.up create_table :flags_pages, :id => false do |t| t.integer :flag_id diff --git a/db/migrate/20090206201554_add_head_id_to_node.rb b/db/migrate/20090206201554_add_head_id_to_node.rb index 7f4af4f..0e580c7 100644 --- a/db/migrate/20090206201554_add_head_id_to_node.rb +++ b/db/migrate/20090206201554_add_head_id_to_node.rb @@ -1,4 +1,4 @@ -class AddHeadIdToNode < ActiveRecord::Migration +class AddHeadIdToNode < ActiveRecord::Migration[4.2] def self.up add_column :nodes, :head_id, :integer end diff --git a/db/migrate/20090208130829_create_users.rb b/db/migrate/20090208130829_create_users.rb index e91193c..1bd5228 100644 --- a/db/migrate/20090208130829_create_users.rb +++ b/db/migrate/20090208130829_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration +class CreateUsers < ActiveRecord::Migration[4.2] def self.up create_table :users do |t| t.string :login diff --git a/db/migrate/20090208130906_add_user_id_to_pages.rb b/db/migrate/20090208130906_add_user_id_to_pages.rb index 02ebdef..4172829 100644 --- a/db/migrate/20090208130906_add_user_id_to_pages.rb +++ b/db/migrate/20090208130906_add_user_id_to_pages.rb @@ -1,4 +1,4 @@ -class AddUserIdToPages < ActiveRecord::Migration +class AddUserIdToPages < ActiveRecord::Migration[4.2] def self.up add_column :pages, :user_id, :integer end diff --git a/db/migrate/20090211220524_create_permissions.rb b/db/migrate/20090211220524_create_permissions.rb index 2e007a4..4ef6bc4 100644 --- a/db/migrate/20090211220524_create_permissions.rb +++ b/db/migrate/20090211220524_create_permissions.rb @@ -1,4 +1,4 @@ -class CreatePermissions < ActiveRecord::Migration +class CreatePermissions < ActiveRecord::Migration[4.2] def self.up create_table :permissions do |t| t.boolean :granted diff --git a/db/migrate/20090301104237_add_draft_id_to_nodes.rb b/db/migrate/20090301104237_add_draft_id_to_nodes.rb index a0ea672..32a79e5 100644 --- a/db/migrate/20090301104237_add_draft_id_to_nodes.rb +++ b/db/migrate/20090301104237_add_draft_id_to_nodes.rb @@ -1,4 +1,4 @@ -class AddDraftIdToNodes < ActiveRecord::Migration +class AddDraftIdToNodes < ActiveRecord::Migration[4.2] def self.up add_column :nodes, :draft_id, :integer end diff --git a/db/migrate/20090302184350_add_template_column_to_pages.rb b/db/migrate/20090302184350_add_template_column_to_pages.rb index e3aac66..c4d2ca3 100644 --- a/db/migrate/20090302184350_add_template_column_to_pages.rb +++ b/db/migrate/20090302184350_add_template_column_to_pages.rb @@ -1,4 +1,4 @@ -class AddTemplateColumnToPages < ActiveRecord::Migration +class AddTemplateColumnToPages < ActiveRecord::Migration[4.2] def self.up add_column :pages, :template, :string end diff --git a/db/migrate/20090302215335_rename_template_to_template_name.rb b/db/migrate/20090302215335_rename_template_to_template_name.rb index 288209e..6efe523 100644 --- a/db/migrate/20090302215335_rename_template_to_template_name.rb +++ b/db/migrate/20090302215335_rename_template_to_template_name.rb @@ -1,4 +1,4 @@ -class RenameTemplateToTemplateName < ActiveRecord::Migration +class RenameTemplateToTemplateName < ActiveRecord::Migration[4.2] def self.up rename_column :pages, :template, :template_name end diff --git a/db/migrate/20090316194152_create_events.rb b/db/migrate/20090316194152_create_events.rb index 7f44fdf..4bf1174 100644 --- a/db/migrate/20090316194152_create_events.rb +++ b/db/migrate/20090316194152_create_events.rb @@ -1,4 +1,4 @@ -class CreateEvents < ActiveRecord::Migration +class CreateEvents < ActiveRecord::Migration[4.2] def self.up create_table :events do |t| t.datetime :start_time diff --git a/db/migrate/20090316195143_create_occurrences.rb b/db/migrate/20090316195143_create_occurrences.rb index e0df07b..e397e3c 100644 --- a/db/migrate/20090316195143_create_occurrences.rb +++ b/db/migrate/20090316195143_create_occurrences.rb @@ -1,4 +1,4 @@ -class CreateOccurrences < ActiveRecord::Migration +class CreateOccurrences < ActiveRecord::Migration[4.2] def self.up create_table :occurrences do |t| t.string :summary diff --git a/db/migrate/20090318203913_add_location_to_event.rb b/db/migrate/20090318203913_add_location_to_event.rb index 5345781..40dfbf1 100644 --- a/db/migrate/20090318203913_add_location_to_event.rb +++ b/db/migrate/20090318203913_add_location_to_event.rb @@ -1,4 +1,4 @@ -class AddLocationToEvent < ActiveRecord::Migration +class AddLocationToEvent < ActiveRecord::Migration[4.2] def self.up add_column :events, :location, :text end diff --git a/db/migrate/20090318212438_remove_summary_column_from_occurrences.rb b/db/migrate/20090318212438_remove_summary_column_from_occurrences.rb index 7110987..101b87c 100644 --- a/db/migrate/20090318212438_remove_summary_column_from_occurrences.rb +++ b/db/migrate/20090318212438_remove_summary_column_from_occurrences.rb @@ -1,4 +1,4 @@ -class RemoveSummaryColumnFromOccurrences < ActiveRecord::Migration +class RemoveSummaryColumnFromOccurrences < ActiveRecord::Migration[4.2] def self.up remove_column :occurrences, :summary end diff --git a/db/migrate/20090321150359_add_locking_user_id_to_nodes.rb b/db/migrate/20090321150359_add_locking_user_id_to_nodes.rb index b40dd71..32332c6 100644 --- a/db/migrate/20090321150359_add_locking_user_id_to_nodes.rb +++ b/db/migrate/20090321150359_add_locking_user_id_to_nodes.rb @@ -1,4 +1,4 @@ -class AddLockingUserIdToNodes < ActiveRecord::Migration +class AddLockingUserIdToNodes < ActiveRecord::Migration[4.2] def self.up add_column :nodes, :locking_user_id, :integer end diff --git a/db/migrate/20090401190026_add_full_name_to_users.rb b/db/migrate/20090401190026_add_full_name_to_users.rb index a2599e7..8bac436 100644 --- a/db/migrate/20090401190026_add_full_name_to_users.rb +++ b/db/migrate/20090401190026_add_full_name_to_users.rb @@ -1,4 +1,4 @@ -class AddFullNameToUsers < ActiveRecord::Migration +class AddFullNameToUsers < ActiveRecord::Migration[4.2] def self.up end diff --git a/db/migrate/20090424085851_create_assets.rb b/db/migrate/20090424085851_create_assets.rb index c7f1796..f6373b1 100644 --- a/db/migrate/20090424085851_create_assets.rb +++ b/db/migrate/20090424085851_create_assets.rb @@ -1,4 +1,4 @@ -class CreateAssets < ActiveRecord::Migration +class CreateAssets < ActiveRecord::Migration[4.2] def self.up create_table :assets do |t| t.string :name diff --git a/db/migrate/20090719180204_create_menu_items.rb b/db/migrate/20090719180204_create_menu_items.rb index a05012a..daf9597 100644 --- a/db/migrate/20090719180204_create_menu_items.rb +++ b/db/migrate/20090719180204_create_menu_items.rb @@ -1,4 +1,4 @@ -class CreateMenuItems < ActiveRecord::Migration +class CreateMenuItems < ActiveRecord::Migration[4.2] def self.up create_table :menu_items do |t| t.integer :node_id diff --git a/db/migrate/20090809104800_add_position_to_menu_items.rb b/db/migrate/20090809104800_add_position_to_menu_items.rb index 97ff6f9..19f7825 100644 --- a/db/migrate/20090809104800_add_position_to_menu_items.rb +++ b/db/migrate/20090809104800_add_position_to_menu_items.rb @@ -1,4 +1,4 @@ -class AddPositionToMenuItems < ActiveRecord::Migration +class AddPositionToMenuItems < ActiveRecord::Migration[4.2] def self.up add_column :menu_items, :position, :integer end diff --git a/db/migrate/20090815220058_migrate_tagging_tables.rb b/db/migrate/20090815220058_migrate_tagging_tables.rb index e28a16e..23848da 100644 --- a/db/migrate/20090815220058_migrate_tagging_tables.rb +++ b/db/migrate/20090815220058_migrate_tagging_tables.rb @@ -1,4 +1,4 @@ -class MigrateTaggingTables < ActiveRecord::Migration +class MigrateTaggingTables < ActiveRecord::Migration[4.2] def self.up add_column :tags, :taggings_count, :integer, :default => 0, :null => false add_column :taggings, :user_id, :integer diff --git a/db/migrate/20090901051946_create_related_assets.rb b/db/migrate/20090901051946_create_related_assets.rb index 849bf19..9c7b5bc 100644 --- a/db/migrate/20090901051946_create_related_assets.rb +++ b/db/migrate/20090901051946_create_related_assets.rb @@ -1,4 +1,4 @@ -class CreateRelatedAssets < ActiveRecord::Migration +class CreateRelatedAssets < ActiveRecord::Migration[4.2] def self.up create_table :related_assets do |t| t.integer :asset_id diff --git a/db/migrate/20090901095657_add_indices.rb b/db/migrate/20090901095657_add_indices.rb index 6dd54b2..15d3d77 100644 --- a/db/migrate/20090901095657_add_indices.rb +++ b/db/migrate/20090901095657_add_indices.rb @@ -1,4 +1,4 @@ -class AddIndices < ActiveRecord::Migration +class AddIndices < ActiveRecord::Migration[4.2] def self.up change_table :pages do |t| t.index :id diff --git a/db/migrate/20090907103525_add_type_column_to_menu_items.rb b/db/migrate/20090907103525_add_type_column_to_menu_items.rb index dda0f9c..ae935da 100644 --- a/db/migrate/20090907103525_add_type_column_to_menu_items.rb +++ b/db/migrate/20090907103525_add_type_column_to_menu_items.rb @@ -1,4 +1,4 @@ -class AddTypeColumnToMenuItems < ActiveRecord::Migration +class AddTypeColumnToMenuItems < ActiveRecord::Migration[4.2] def self.up add_column :menu_items, :type, :string end diff --git a/db/migrate/20090907111533_add_type_id_to_menu_items.rb b/db/migrate/20090907111533_add_type_id_to_menu_items.rb index 5000e92..ea6790a 100644 --- a/db/migrate/20090907111533_add_type_id_to_menu_items.rb +++ b/db/migrate/20090907111533_add_type_id_to_menu_items.rb @@ -1,4 +1,4 @@ -class AddTypeIdToMenuItems < ActiveRecord::Migration +class AddTypeIdToMenuItems < ActiveRecord::Migration[4.2] def self.up add_column :menu_items, :type_id, :integer end diff --git a/db/migrate/20090909113832_add_staged_slug_and_parent_id.rb b/db/migrate/20090909113832_add_staged_slug_and_parent_id.rb index ab883ca..2a65445 100644 --- a/db/migrate/20090909113832_add_staged_slug_and_parent_id.rb +++ b/db/migrate/20090909113832_add_staged_slug_and_parent_id.rb @@ -1,4 +1,4 @@ -class AddStagedSlugAndParentId < ActiveRecord::Migration +class AddStagedSlugAndParentId < ActiveRecord::Migration[4.2] def self.up add_column :nodes, :staged_slug, :string add_column :nodes, :staged_parent_id, :integer diff --git a/db/migrate/20090917180422_add_admin_flag_to_user.rb b/db/migrate/20090917180422_add_admin_flag_to_user.rb index d15c866..e33f5dd 100644 --- a/db/migrate/20090917180422_add_admin_flag_to_user.rb +++ b/db/migrate/20090917180422_add_admin_flag_to_user.rb @@ -1,4 +1,4 @@ -class AddAdminFlagToUser < ActiveRecord::Migration +class AddAdminFlagToUser < ActiveRecord::Migration[4.2] def self.up add_column :users, :admin, :boolean end diff --git a/db/migrate/20091111154113_add_editor_id_to_pages.rb b/db/migrate/20091111154113_add_editor_id_to_pages.rb index 971b8a3..bc13240 100644 --- a/db/migrate/20091111154113_add_editor_id_to_pages.rb +++ b/db/migrate/20091111154113_add_editor_id_to_pages.rb @@ -1,4 +1,4 @@ -class AddEditorIdToPages < ActiveRecord::Migration +class AddEditorIdToPages < ActiveRecord::Migration[4.2] def self.up add_column :pages, :editor_id, :integer end diff --git a/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb b/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb index 5051239..4dad8a9 100644 --- a/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb +++ b/db/migrate/20260623232228_upgrade_taggings_for_acts_as_taggable_on.rb @@ -1,4 +1,4 @@ -class UpgradeTaggingsForActsAsTaggableOn < ActiveRecord::Migration +class UpgradeTaggingsForActsAsTaggableOn < ActiveRecord::Migration[4.2] def up add_column :taggings, :context, :string add_column :taggings, :tagger_id, :integer diff --git a/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb index 6bbd559..35daedd 100644 --- a/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +++ b/db/migrate/20260624035149_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 1) -class ActsAsTaggableOnMigration < ActiveRecord::Migration +class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2] def self.up create_table :tags do |t| t.string :name diff --git a/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb index 4ca676f..52f9ab5 100644 --- a/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb +++ b/db/migrate/20260624035150_add_missing_unique_indices.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 2) -class AddMissingUniqueIndices < ActiveRecord::Migration +class AddMissingUniqueIndices < ActiveRecord::Migration[4.2] def self.up add_index :tags, :name, unique: true diff --git a/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb index 8edb508..5a3f71a 100644 --- a/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +++ b/db/migrate/20260624035151_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 3) -class AddTaggingsCounterCacheToTags < ActiveRecord::Migration +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2] def self.up add_column :tags, :taggings_count, :integer, default: 0 diff --git a/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb index 71f2d7f..f287376 100644 --- a/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb +++ b/db/migrate/20260624035152_add_missing_taggable_index.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 4) -class AddMissingTaggableIndex < ActiveRecord::Migration +class AddMissingTaggableIndex < ActiveRecord::Migration[4.2] def self.up add_index :taggings, [:taggable_id, :taggable_type, :context] end diff --git a/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb index bfb06bc..4c144a8 100644 --- a/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +++ b/db/migrate/20260624035153_change_collation_for_tag_names.acts_as_taggable_on_engine.rb @@ -1,7 +1,7 @@ # This migration comes from acts_as_taggable_on_engine (originally 5) # This migration is added to circumvent issue #623 and have special characters # work properly -class ChangeCollationForTagNames < ActiveRecord::Migration +class ChangeCollationForTagNames < ActiveRecord::Migration[4.2] def up if ActsAsTaggableOn::Utils.using_mysql? execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") -- cgit v1.3