diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 5462378..a655de2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -28,6 +28,7 @@ jobs: ruby: ["3.2", "3.3", "3.4", "4.0"] gemfile: - rails_71 + - rails_72 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/Appraisals b/Appraisals index f516f64..86ef6c5 100644 --- a/Appraisals +++ b/Appraisals @@ -12,3 +12,7 @@ HEADING appraise "rails_71" do gem "rails", "~> 7.1.0" end + +appraise "rails_72" do + gem "rails", "~> 7.2.0" +end diff --git a/gemfiles/rails_72.gemfile b/gemfiles/rails_72.gemfile new file mode 100644 index 0000000..34b40fc --- /dev/null +++ b/gemfiles/rails_72.gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "publify_core", git: "https://github.com/publify/publify_core.git" +gem "rails", "~> 7.2.0" + +gemspec path: "../" diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 112f4e6..5a3d419 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -31,5 +31,8 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. + + # Load migrations directly from the PublifyCore engine + config.paths["db/migrate"] << PublifyCore::Engine.root.join("db/migrate") end end diff --git a/spec/dummy/db/migrate/20160712061341_initial_schema.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061341_initial_schema.publify_core_engine.rb deleted file mode 100644 index a294a25..0000000 --- a/spec/dummy/db/migrate/20160712061341_initial_schema.publify_core_engine.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 113) - -class InitialSchema < ActiveRecord::Migration[4.2] - def change - create_table "articles_tags", id: false, force: true do |t| - t.integer "article_id" - t.integer "tag_id" - end - - create_table "blogs", force: true do |t| - t.text "settings" - t.string "base_url" - end - - create_table "categories", force: true do |t| - t.string "name" - t.integer "position" - t.string "permalink" - t.text "keywords" - t.text "description" - t.integer "parent_id" - end - - add_index "categories", ["permalink"] - - create_table "categorizations", force: true do |t| - t.integer "article_id" - t.integer "category_id" - t.boolean "is_primary" - end - - create_table "contents", force: true do |t| - t.string "type" - t.string "title" - t.string "author" - t.text "body" - t.text "extended" - t.text "excerpt" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "user_id" - t.string "permalink" - t.string "guid" - t.integer "text_filter_id" - t.text "whiteboard" - t.string "name" - t.boolean "published", default: false - t.boolean "allow_pings" - t.boolean "allow_comments" - t.datetime "published_at" - t.string "state" - t.integer "parent_id" - t.text "settings" - t.string "post_type", default: "read" - end - - add_index "contents", ["published"] - add_index "contents", ["text_filter_id"] - - create_table "feedback", force: true do |t| - t.string "type" - t.string "title" - t.string "author" - t.text "body" - t.text "excerpt" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "user_id" - t.string "guid" - t.integer "text_filter_id" - t.text "whiteboard" - t.integer "article_id" - t.string "email" - t.string "url" - t.string "ip", limit: 40 - t.string "blog_name" - t.boolean "published", default: false - t.datetime "published_at" - t.string "state" - t.boolean "status_confirmed" - t.string "user_agent" - end - - add_index "feedback", ["article_id"] - add_index "feedback", ["text_filter_id"] - - create_table "page_caches", force: true do |t| - t.string "name" - end - - add_index "page_caches", ["name"] - - create_table "pings", force: true do |t| - t.integer "article_id" - t.string "url" - t.datetime "created_at" - end - - add_index "pings", ["article_id"] - - create_table "post_types", force: true do |t| - t.string "name" - t.string "permalink" - t.string "description" - end - - create_table "profiles", force: true do |t| - t.string "label" - t.string "nicename" - t.text "modules" - end - - create_table "profiles_rights", id: false, force: true do |t| - t.integer "profile_id" - t.integer "right_id" - end - - create_table "redirections", force: true do |t| - t.integer "content_id" - t.integer "redirect_id" - end - - create_table "redirects", force: true do |t| - t.string "from_path" - t.string "to_path" - t.string "origin" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "resources", force: true do |t| - t.integer "size" - t.string "upload" - t.string "mime" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "article_id" - t.boolean "itunes_metadata" - t.string "itunes_author" - t.string "itunes_subtitle" - t.integer "itunes_duration" - t.text "itunes_summary" - t.string "itunes_keywords" - t.string "itunes_category" - t.boolean "itunes_explicit" - end - - create_table "sidebars", force: true do |t| - t.integer "active_position" - t.text "config" - t.integer "staged_position" - t.string "type" - end - - create_table "sitealizer", force: true do |t| - t.string "path" - t.string "ip" - t.string "referer" - t.string "language" - t.string "user_agent" - t.datetime "created_at" - t.date "created_on" - end - - create_table "tags", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - t.string "display_name" - end - - create_table "text_filters", force: true do |t| - t.string "name" - t.string "description" - t.string "markup" - t.text "filters" - t.text "params" - end - - create_table "triggers", force: true do |t| - t.integer "pending_item_id" - t.string "pending_item_type" - t.datetime "due_at" - t.string "trigger_method" - end - - create_table "users", force: true do |t| - t.string "login" - t.string "password" - t.text "email" - t.text "name" - t.boolean "notify_via_email" - t.boolean "notify_on_new_articles" - t.boolean "notify_on_comments" - t.integer "profile_id" - t.string "remember_token" - t.datetime "remember_token_expires_at" - t.string "text_filter_id", default: "1" - t.string "state", default: "active" - t.datetime "last_connection" - t.text "settings" - t.integer "resource_id" - end - end -end diff --git a/spec/dummy/db/migrate/20160712061342_fixes_buggy_articles_and_notes.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061342_fixes_buggy_articles_and_notes.publify_core_engine.rb deleted file mode 100644 index b73e7d4..0000000 --- a/spec/dummy/db/migrate/20160712061342_fixes_buggy_articles_and_notes.publify_core_engine.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 114) -class FixesBuggyArticlesAndNotes < ActiveRecord::Migration[4.2] - class Content < ActiveRecord::Base - end - - class Article < Content - def set_permalink - return if state == "draft" || permalink.present? - - self.permalink = title.to_permalink - end - end - - class Note < Content - def set_permalink - self.permalink = "#{id}-#{body.to_permalink[0..79]}" if permalink.blank? - save - end - - def create_guid - return true if guid.present? - - self.guid = UUIDTools::UUID.random_create.to_s - end - end - - class Page < Content - def set_permalink - self.name = title.to_permalink if name.blank? - end - end - - def self.up - say "Fixing contents permalinks, this may take some time" - - contents = Content.where("permalink is ? or permalink = ?", nil, "") - contents.each do |c| - c.set_permalink - c.save - end - - say "Fixes empty notes GUID" - notes = Note.where("guid is ? or guid = ?", nil, "") - notes.each do |n| - n.create_guid - n.save - end - end - - def self.down - say "Nothing to do here" - end -end diff --git a/spec/dummy/db/migrate/20160712061343_drops_categories_for_tags.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061343_drops_categories_for_tags.publify_core_engine.rb deleted file mode 100644 index a7ff00c..0000000 --- a/spec/dummy/db/migrate/20160712061343_drops_categories_for_tags.publify_core_engine.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 115) -class DropsCategoriesForTags < ActiveRecord::Migration[4.2] - class Categorization < ActiveRecord::Base - belongs_to :article - belongs_to :category - end - - class Category < ActiveRecord::Base - has_many :categorizations - has_many :articles, through: :categorizations - end - - def up - # First, we migrate categories into tags - Category.find_each do |cat| - # Does a tag with the same permalink exist? - tag = Tag.find_or_create_by(name: cat.permalink) do |tg| - tg.display_name = cat.name - end - - Redirect.create(from_path: "category/#{cat.permalink}", - to_path: File.join(Blog.first.base_url, "tag", tag.name)) - cat.articles.each do |article| - article.tags << tag - article.save - end - end - - drop_table :categorizations - drop_table :categories - end - - def down; end -end diff --git a/spec/dummy/db/migrate/20160712061344_add_missing_indexes.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061344_add_missing_indexes.publify_core_engine.rb deleted file mode 100644 index 693e404..0000000 --- a/spec/dummy/db/migrate/20160712061344_add_missing_indexes.publify_core_engine.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20150207131657) -class AddMissingIndexes < ActiveRecord::Migration[4.2] - def change - add_index :feedback, [:id, :type] - add_index :feedback, :user_id - add_index :sidebars, [:id, :type] - add_index :contents, :user_id - add_index :contents, [:id, :type] - add_index :articles_tags, :tag_id - add_index :articles_tags, :article_id - add_index :profiles_rights, :profile_id - add_index :users, :profile_id - add_index :users, :text_filter_id - add_index :users, :resource_id - add_index :triggers, [:pending_item_id, :pending_item_type] - add_index :redirections, :content_id - add_index :redirections, :redirect_id - add_index :resources, :article_id - end -end diff --git a/spec/dummy/db/migrate/20160712061345_simplify_redirect_relations.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061345_simplify_redirect_relations.publify_core_engine.rb deleted file mode 100644 index a12a2aa..0000000 --- a/spec/dummy/db/migrate/20160712061345_simplify_redirect_relations.publify_core_engine.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20150807134129) -class SimplifyRedirectRelations < ActiveRecord::Migration[4.2] - class Redirect < ActiveRecord::Base; end - - class Redirection < ActiveRecord::Base; end - - def up - add_column :redirects, :content_id, :integer - Redirect.find_each do |redirect| - redirections = Redirection.where(redirect_id: redirect.id) - if redirections.many? - raise "Expected zero or one redirections, found #{redirections.count}" - end - - redirection = redirections.first - next unless redirection - - redirect.content_id = redirection.content_id - redirect.save! - end - remove_column :redirects, :origin - drop_table :redirections - end - - def down - create_table :redirections do |t| - t.integer :content_id - t.integer :redirect_id - end - - add_index :redirections, [:content_id] - add_index :redirections, [:redirect_id] - - add_column :redirects, :origin, :string - - Redirect.find_each do |redirect| - next unless redirect.content_id - - Redirection.create(redirect_id: redirect.id, content_id: redirect.content_id) - end - remove_column :redirects, :content_id - end -end diff --git a/spec/dummy/db/migrate/20160712061346_add_blog_ids.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061346_add_blog_ids.publify_core_engine.rb deleted file mode 100644 index 4efd5fb..0000000 --- a/spec/dummy/db/migrate/20160712061346_add_blog_ids.publify_core_engine.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20150808052637) -class AddBlogIds < ActiveRecord::Migration[4.2] - class Blog < ActiveRecord::Base; end - - class Content < ActiveRecord::Base; end - - class Sidebar < ActiveRecord::Base; end - - def up - add_column :contents, :blog_id, :integer - add_column :sidebars, :blog_id, :integer - - if Content.any? || Sidebar.any? - default_blog_id = Blog.order(:id).first.id - - Content.update_all("blog_id = #{default_blog_id}") - Sidebar.update_all("blog_id = #{default_blog_id}") - end - - change_column :sidebars, :blog_id, :integer, null: false - end - - def down - if adapter_name == "PostgreSQL" - indexes(:contents).each do |index| - remove_index(:contents, name: index.name) if index.name.include?("blog_id") - end - else - begin - remove_index :contents, :blog_id - rescue - nil - end - end - remove_column :contents, :blog_id - remove_column :sidebars, :blog_id - end -end diff --git a/spec/dummy/db/migrate/20160712061347_add_blog_id_to_redirects.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061347_add_blog_id_to_redirects.publify_core_engine.rb deleted file mode 100644 index 971eb7b..0000000 --- a/spec/dummy/db/migrate/20160712061347_add_blog_id_to_redirects.publify_core_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20150808191127) -class AddBlogIdToRedirects < ActiveRecord::Migration[4.2] - class Redirect < ActiveRecord::Base; end - - def up - add_column :redirects, :blog_id, :integer - if Redirect.any? - default_blog_id = Blog.order(:id).first.id - Redirect.update_all("blog_id = #{default_blog_id}") - end - end - - def down - remove_column :redirects, :blog_id - end -end diff --git a/spec/dummy/db/migrate/20160712061348_add_blog_id_to_tags.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061348_add_blog_id_to_tags.publify_core_engine.rb deleted file mode 100644 index c9d4664..0000000 --- a/spec/dummy/db/migrate/20160712061348_add_blog_id_to_tags.publify_core_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20150810094754) -class AddBlogIdToTags < ActiveRecord::Migration[4.2] - class Tag < ActiveRecord::Base; end - - def up - add_column :tags, :blog_id, :integer - if Tag.any? - default_blog_id = Blog.order(:id).first.id - Tag.update_all("blog_id = #{default_blog_id}") - end - end - - def down - remove_column :tags, :blog_id - end -end diff --git a/spec/dummy/db/migrate/20160712061349_add_devise_to_users.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061349_add_devise_to_users.publify_core_engine.rb deleted file mode 100644 index 38d8621..0000000 --- a/spec/dummy/db/migrate/20160712061349_add_devise_to_users.publify_core_engine.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160108111120) -class AddDeviseToUsers < ActiveRecord::Migration[4.2] - def self.up - ## Database authenticatable - change_column :users, :email, :string, null: false, default: "" - rename_column :users, :password, :encrypted_password - change_column :users, :encrypted_password, :string, null: false, default: "" - - change_table(:users) do |t| - ## Recoverable - t.string :reset_password_token - t.datetime :reset_password_sent_at - - ## Rememberable - t.datetime :remember_created_at - - ## Trackable - t.integer :sign_in_count, default: 0, null: false - t.datetime :current_sign_in_at - t.datetime :last_sign_in_at - t.string :current_sign_in_ip - t.string :last_sign_in_ip - - # Timestamps were not included in our original model. - t.timestamps - end - - add_index :users, :email, unique: true - add_index :users, :reset_password_token, unique: true - end - - def self.down - remove_index :users, :email - remove_index :users, :reset_password_token - - remove_column :users, :created_at - remove_column :users, :updated_at - - remove_column :users, :sign_in_count - remove_column :users, :current_sign_in_at - remove_column :users, :last_sign_in_at - remove_column :users, :current_sign_in_ip - remove_column :users, :last_sign_in_ip - - remove_column :users, :remember_created_at - - remove_column :users, :reset_password_token - remove_column :users, :reset_password_sent_at - - change_column :users, :encrypted_password, :string, null: true, default: nil - rename_column :users, :encrypted_password, :password - change_column :users, :email, :text, null: true, default: nil - end -end diff --git a/spec/dummy/db/migrate/20160712061350_move_last_connection_to_last_sign_in_at.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061350_move_last_connection_to_last_sign_in_at.publify_core_engine.rb deleted file mode 100644 index 8044c23..0000000 --- a/spec/dummy/db/migrate/20160712061350_move_last_connection_to_last_sign_in_at.publify_core_engine.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160108184201) -class MoveLastConnectionToLastSignInAt < ActiveRecord::Migration[4.2] - class User < ActiveRecord::Base - end - - def up - User.find_each do |user| - user.update_attribute(:last_sign_in_at, user.last_connection) - end - end - - def down - User.find_each do |user| - user.update_attribute(:last_connection, user.last_sign_in_at) - end - end -end diff --git a/spec/dummy/db/migrate/20160712061351_remove_profiles_rights.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061351_remove_profiles_rights.publify_core_engine.rb deleted file mode 100644 index bf59d19..0000000 --- a/spec/dummy/db/migrate/20160712061351_remove_profiles_rights.publify_core_engine.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160110094906) -class RemoveProfilesRights < ActiveRecord::Migration[4.2] - def up - drop_table :profiles_rights - end - - def down - create_table :profiles_rights, id: false do |t| - t.integer :profile_id - t.integer :right_id - end - - add_index :profiles_rights, [:profile_id] - end -end diff --git a/spec/dummy/db/migrate/20160712061352_replace_profile_id_with_string.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061352_replace_profile_id_with_string.publify_core_engine.rb deleted file mode 100644 index 92efbfc..0000000 --- a/spec/dummy/db/migrate/20160712061352_replace_profile_id_with_string.publify_core_engine.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160605103918) -class ReplaceProfileIdWithString < ActiveRecord::Migration[4.2] - class Profile < ActiveRecord::Base - end - - class User < ActiveRecord::Base - end - - def up - add_column :users, :profile, :string - - User.reset_column_information - User.find_each do |user| - user.update_attribute(:profile, Profile.find(user.profile_id).label) - end - - remove_column :users, :profile_id - end - - def down - add_column :users, :profile_id, :integer - - User.reset_column_information - User.find_each do |user| - user.update_attribute(:profile_id, Profile.find_by(label: user.profile).id) - end - - remove_column :users, :profile - end -end diff --git a/spec/dummy/db/migrate/20160712061353_remove_profiles.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061353_remove_profiles.publify_core_engine.rb deleted file mode 100644 index ca11db5..0000000 --- a/spec/dummy/db/migrate/20160712061353_remove_profiles.publify_core_engine.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160605154632) -class RemoveProfiles < ActiveRecord::Migration[4.2] - class Profile < ActiveRecord::Base - serialize :modules - end - - def up - drop_table :profiles - end - - def down - create_table :profiles do |t| - t.string :label - t.string :nicename - t.text :modules - end - - Profile.create!(label: "admin", nicename: "Publify administrator", - modules: [:dashboard, :articles, :notes, :pages, :feedback, - :media, :themes, :sidebar, :profile, :users, - :settings, :seo]) - Profile.create!(label: "publisher", nicename: "Blog publisher", - modules: [:dashboard, :articles, :notes, :pages, :feedback, - :media, :profile]) - Profile.create!(label: "contributor", nicename: "Contributor", - modules: [:dashboard, :profile]) - end -end diff --git a/spec/dummy/db/migrate/20160712061354_demand_blog_id_on_contents.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061354_demand_blog_id_on_contents.publify_core_engine.rb deleted file mode 100644 index 21148a0..0000000 --- a/spec/dummy/db/migrate/20160712061354_demand_blog_id_on_contents.publify_core_engine.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160701061851) -class DemandBlogIdOnContents < ActiveRecord::Migration[4.2] - def up - change_column :contents, :blog_id, :integer, null: false - end - - def down - change_column :contents, :blog_id, :integer, null: true - end -end diff --git a/spec/dummy/db/migrate/20160712061355_add_blog_id_to_resources.publify_core_engine.rb b/spec/dummy/db/migrate/20160712061355_add_blog_id_to_resources.publify_core_engine.rb deleted file mode 100644 index 5d1ce47..0000000 --- a/spec/dummy/db/migrate/20160712061355_add_blog_id_to_resources.publify_core_engine.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20160701062604) -class AddBlogIdToResources < ActiveRecord::Migration[4.2] - class Blog < ActiveRecord::Base; end - - class Content < ActiveRecord::Base; end - - class Resource < ActiveRecord::Base; end - - def up - add_column :resources, :blog_id, :integer - - if Resource.any? - default_blog_id = Blog.order(:id).first.id - Resource.find_each do |resource| - content_id = resource.article_id - blog_id = if content_id - Content.find(content_id).blog_id - else - default_blog_id - end - resource.update_column(:blog_id, blog_id) - end - end - - change_column :resources, :blog_id, :integer, null: false - end - - def down - remove_column :resources, :blog_id - end -end diff --git a/spec/dummy/db/migrate/20170528164251_move_resources_to_content.publify_core_engine.rb b/spec/dummy/db/migrate/20170528164251_move_resources_to_content.publify_core_engine.rb deleted file mode 100644 index ac6dc3c..0000000 --- a/spec/dummy/db/migrate/20170528164251_move_resources_to_content.publify_core_engine.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20170528093024) -class MoveResourcesToContent < ActiveRecord::Migration[5.0] - def change - rename_column :resources, :article_id, :content_id - end -end diff --git a/spec/dummy/db/migrate/20170528164439_move_tags_to_content.publify_core_engine.rb b/spec/dummy/db/migrate/20170528164439_move_tags_to_content.publify_core_engine.rb deleted file mode 100644 index 59ea61e..0000000 --- a/spec/dummy/db/migrate/20170528164439_move_tags_to_content.publify_core_engine.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20170528094923) -class MoveTagsToContent < ActiveRecord::Migration[5.0] - def change - rename_column :articles_tags, :article_id, :content_id - rename_table :articles_tags, :contents_tags - end -end diff --git a/spec/dummy/db/migrate/20170530063928_remove_separate_published_flag.publify_core_engine.rb b/spec/dummy/db/migrate/20170530063928_remove_separate_published_flag.publify_core_engine.rb deleted file mode 100644 index 8bacee4..0000000 --- a/spec/dummy/db/migrate/20170530063928_remove_separate_published_flag.publify_core_engine.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20170528201606) -class RemoveSeparatePublishedFlag < ActiveRecord::Migration[5.0] - def change - remove_column :contents, :published, :boolean, default: false - end -end diff --git a/spec/dummy/db/migrate/20170605103440_remove_extra_state_columns_from_feedback.publify_core_engine.rb b/spec/dummy/db/migrate/20170605103440_remove_extra_state_columns_from_feedback.publify_core_engine.rb deleted file mode 100644 index 4170f82..0000000 --- a/spec/dummy/db/migrate/20170605103440_remove_extra_state_columns_from_feedback.publify_core_engine.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20170605071626) -class RemoveExtraStateColumnsFromFeedback < ActiveRecord::Migration[5.0] - def change - remove_column :feedback, :published, :boolean, default: false - remove_column :feedback, :status_confirmed, :boolean - end -end diff --git a/spec/dummy/db/migrate/20170702105825_remove_published_at_from_feedback.publify_core_engine.rb b/spec/dummy/db/migrate/20170702105825_remove_published_at_from_feedback.publify_core_engine.rb deleted file mode 100644 index d6ae27f..0000000 --- a/spec/dummy/db/migrate/20170702105825_remove_published_at_from_feedback.publify_core_engine.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20170702105201) -class RemovePublishedAtFromFeedback < ActiveRecord::Migration[5.0] - def change - remove_column :feedback, :published_at, :datetime - end -end diff --git a/spec/dummy/db/migrate/20190210121538_add_text_filter_name_fields.publify_core_engine.rb b/spec/dummy/db/migrate/20190210121538_add_text_filter_name_fields.publify_core_engine.rb deleted file mode 100644 index 60b1299..0000000 --- a/spec/dummy/db/migrate/20190210121538_add_text_filter_name_fields.publify_core_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20190208151235) -class AddTextFilterNameFields < ActiveRecord::Migration[5.2] - def change - add_column :contents, :text_filter_name, :string - add_column :feedback, :text_filter_name, :string - add_column :users, :text_filter_name, :string - end -end diff --git a/spec/dummy/db/migrate/20190210121539_move_text_filter_to_name.publify_core_engine.rb b/spec/dummy/db/migrate/20190210121539_move_text_filter_to_name.publify_core_engine.rb deleted file mode 100644 index 2583b99..0000000 --- a/spec/dummy/db/migrate/20190210121539_move_text_filter_to_name.publify_core_engine.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20190208152646) -class MoveTextFilterToName < ActiveRecord::Migration[5.2] - class Content < ActiveRecord::Base - self.inheritance_column = :bogus - - belongs_to :text_filter, optional: true - end - - class Feedback < ActiveRecord::Base - self.table_name = "feedback" - self.inheritance_column = :bogus - - belongs_to :text_filter, optional: true - end - - class User < ActiveRecord::Base - belongs_to :text_filter, optional: true - end - - class TextFilter < ActiveRecord::Base - serialize :filters, Array - serialize :params, Hash - end - - def up - Content.find_each do |content| - filter = content.text_filter - filter_name = filter&.name || "none" - content.update!(text_filter_name: filter_name, text_filter_id: nil) - end - - Feedback.find_each do |feedback| - filter = feedback.text_filter - filter_name = filter&.name || "none" - feedback.update!(text_filter_name: filter_name, text_filter_id: nil) - end - - User.find_each do |user| - filter = user.text_filter - filter_name = filter&.name || "none" - user.update!(text_filter_name: filter_name, text_filter_id: nil) - end - - TextFilter.destroy_all - end - - def down - TextFilter - .create_with(description: "None", markup: "none", filters: [], params: {}) - .find_or_create_by!(name: "none") - TextFilter - .create_with(description: "Markdown", markup: "markdown", filters: [], params: {}) - .find_or_create_by!(name: "markdown") - TextFilter - .create_with(description: "SmartyPants", markup: "none", filters: [:smartypants], - params: {}) - .find_or_create_by!(name: "smartypants") - TextFilter - .create_with(description: "Markdown with SmartyPants", markup: "markdown", - filters: [:smartypants], params: {}) - .find_or_create_by!(name: "markdown smartypants") - TextFilter - .create_with(description: "Textile", markup: "textile", filters: [], params: {}) - .find_or_create_by!(name: "textile") - - Content.find_each do |content| - filter_name = content.text_filter_name - next unless filter_name - - filter = TextFilter.find(name: filter_name) - raise "Filter #{filter_name} not found" unless filter - - content.update!(text_filter: filter) - end - - Feedback.find_each do |feedback| - filter_name = feedback.text_filter_name - next unless filter_name - - filter = TextFilter.find(name: filter_name) - raise "Filter #{filter_name} not found" unless filter - - feedback.update!(text_filter: filter) - end - - User.find_each do |user| - filter_name = user.text_filter_name - next unless filter_name - - filter = TextFilter.find(name: filter_name) - raise "Filter #{filter_name} not found" unless filter - - user.update!(text_filter: filter) - end - end -end diff --git a/spec/dummy/db/migrate/20190210121540_remove_text_filter_ids.publify_core_engine.rb b/spec/dummy/db/migrate/20190210121540_remove_text_filter_ids.publify_core_engine.rb deleted file mode 100644 index 0eee152..0000000 --- a/spec/dummy/db/migrate/20190210121540_remove_text_filter_ids.publify_core_engine.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20190209155717) -class RemoveTextFilterIds < ActiveRecord::Migration[5.2] - def up - remove_column :contents, :text_filter_id - remove_column :feedback, :text_filter_id - remove_column :users, :text_filter_id - end - - def down - add_column :contents, :text_filter_id, :integer - add_column :feedback, :text_filter_id, :integer - add_column :users, :text_filter_id, :string, default: "1" - - add_index :contents, [:text_filter_id] - add_index :feedback, [:text_filter_id] - add_index :users, [:text_filter_id] - end -end diff --git a/spec/dummy/db/migrate/20190210121541_remove_text_filters.publify_core_engine.rb b/spec/dummy/db/migrate/20190210121541_remove_text_filters.publify_core_engine.rb deleted file mode 100644 index 8326fc8..0000000 --- a/spec/dummy/db/migrate/20190210121541_remove_text_filters.publify_core_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20190209160610) -class RemoveTextFilters < ActiveRecord::Migration[5.2] - def up - drop_table :text_filters - end - - def down - create_table :text_filters do |t| - t.string :name - t.string :description - t.string :markup - t.text :filters - t.text :params - end - end -end diff --git a/spec/dummy/db/migrate/20200413141252_add_unique_indexes.publify_core_engine.rb b/spec/dummy/db/migrate/20200413141252_add_unique_indexes.publify_core_engine.rb deleted file mode 100644 index 46a09a3..0000000 --- a/spec/dummy/db/migrate/20200413141252_add_unique_indexes.publify_core_engine.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20200413140440) - -class AddUniqueIndexes < ActiveRecord::Migration[5.2] - def change - add_index :post_types, :name, unique: true - add_index :redirects, :from_path, unique: true - add_index :tags, [:blog_id, :name], unique: true - add_index :users, :login, unique: true - end -end diff --git a/spec/dummy/db/migrate/20221007091137_remove_table_sitealizer.publify_core_engine.rb b/spec/dummy/db/migrate/20221007091137_remove_table_sitealizer.publify_core_engine.rb deleted file mode 100644 index 2589c42..0000000 --- a/spec/dummy/db/migrate/20221007091137_remove_table_sitealizer.publify_core_engine.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20221007091049) -class RemoveTableSitealizer < ActiveRecord::Migration[6.1] - def up - drop_table :sitealizer - end - - def down - create_table :sitealizer do |t| - t.string :path - t.string :ip - t.string :referer - t.string :language - t.string :user_agent - t.datetime :created_at - t.date :created_on - end - end -end diff --git a/spec/dummy/db/migrate/20221010170852_remove_page_caches_table.publify_core_engine.rb b/spec/dummy/db/migrate/20221010170852_remove_page_caches_table.publify_core_engine.rb deleted file mode 100644 index a2f6bc0..0000000 --- a/spec/dummy/db/migrate/20221010170852_remove_page_caches_table.publify_core_engine.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20221010092846) -class RemovePageCachesTable < ActiveRecord::Migration[6.1] - def up - drop_table :page_caches - end - - def down - create_table :page_caches do |t| - t.string :name - end - - add_index :page_caches, :name - end -end diff --git a/spec/dummy/db/migrate/20221012164101_remove_itunes_fields_from_resources.publify_core_engine.rb b/spec/dummy/db/migrate/20221012164101_remove_itunes_fields_from_resources.publify_core_engine.rb deleted file mode 100644 index ec9330f..0000000 --- a/spec/dummy/db/migrate/20221012164101_remove_itunes_fields_from_resources.publify_core_engine.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -# This migration comes from publify_core_engine (originally 20221012163214) -class RemoveItunesFieldsFromResources < ActiveRecord::Migration[6.1] - def change - remove_column :resources, :itunes_metadata, :boolean - remove_column :resources, :itunes_author, :string - remove_column :resources, :itunes_subtitle, :string - remove_column :resources, :itunes_duration, :integer - remove_column :resources, :itunes_summary, :text - remove_column :resources, :itunes_keywords, :string - remove_column :resources, :itunes_category, :string - remove_column :resources, :itunes_explicit, :boolean - end -end diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 585089b..29a8c8e 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -2,16 +2,15 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_10_12_164101) do - +ActiveRecord::Schema[7.1].define(version: 2022_10_12_163214) do create_table "blogs", force: :cascade do |t| t.text "settings" t.string "base_url" @@ -24,8 +23,8 @@ t.text "body" t.text "extended" t.text "excerpt" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.integer "user_id" t.string "permalink" t.string "guid" @@ -33,7 +32,7 @@ t.string "name" t.boolean "allow_pings" t.boolean "allow_comments" - t.datetime "published_at" + t.datetime "published_at", precision: nil t.string "state" t.integer "parent_id" t.text "settings" @@ -57,8 +56,8 @@ t.string "author" t.text "body" t.text "excerpt" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.integer "user_id" t.string "guid" t.text "whiteboard" @@ -78,7 +77,7 @@ create_table "pings", force: :cascade do |t| t.integer "article_id" t.string "url" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.index ["article_id"], name: "index_pings_on_article_id" end @@ -92,8 +91,8 @@ create_table "redirects", force: :cascade do |t| t.string "from_path" t.string "to_path" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.integer "content_id" t.integer "blog_id" t.index ["from_path"], name: "index_redirects_on_from_path", unique: true @@ -103,8 +102,8 @@ t.integer "size" t.string "upload" t.string "mime" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.integer "content_id" t.integer "blog_id", null: false t.index ["content_id"], name: "index_resources_on_content_id" @@ -121,8 +120,8 @@ create_table "tags", force: :cascade do |t| t.string "name" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.string "display_name" t.integer "blog_id" t.index ["blog_id", "name"], name: "index_tags_on_blog_id_and_name", unique: true @@ -131,7 +130,7 @@ create_table "triggers", force: :cascade do |t| t.integer "pending_item_id" t.string "pending_item_type" - t.datetime "due_at" + t.datetime "due_at", precision: nil t.string "trigger_method" t.index ["pending_item_id", "pending_item_type"], name: "index_triggers_on_pending_item_id_and_pending_item_type" end @@ -145,21 +144,21 @@ t.boolean "notify_on_new_articles" t.boolean "notify_on_comments" t.string "remember_token" - t.datetime "remember_token_expires_at" + t.datetime "remember_token_expires_at", precision: nil t.string "state", default: "active" - t.datetime "last_connection" + t.datetime "last_connection", precision: nil t.text "settings" t.integer "resource_id" t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" + t.datetime "reset_password_sent_at", precision: nil + t.datetime "remember_created_at", precision: nil t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" + t.datetime "current_sign_in_at", precision: nil + t.datetime "last_sign_in_at", precision: nil t.string "current_sign_in_ip" t.string "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.string "profile" t.string "text_filter_name" t.index ["email"], name: "index_users_on_email", unique: true