Skip to content

Commit

Permalink
Change database version to 6.0
Browse files Browse the repository at this point in the history
This makes sure we create new databases with Rails 6.0 defaults.
  • Loading branch information
tvdeyen committed Feb 18, 2022
1 parent 65cab8a commit c08916d
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 62 deletions.
60 changes: 30 additions & 30 deletions db/migrate/20200226213334_alchemy_four_point_four.rb
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# frozen_string_literal: true

class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
class AlchemyFourPointFour < ActiveRecord::Migration[6.0]
def up
unless table_exists?("alchemy_attachments")
create_table "alchemy_attachments", force: :cascade do |t|
create_table "alchemy_attachments" do |t|
t.string "name"
t.string "file_name"
t.string "file_mime_type"
t.integer "file_size"
t.references "creator"
t.references "updater"
t.timestamps null: false
t.timestamps
t.string "file_uid"
t.index ["file_uid"], name: "index_alchemy_attachments_on_file_uid"
end
end

unless table_exists?("alchemy_contents")
create_table "alchemy_contents", force: :cascade do |t|
create_table "alchemy_contents" do |t|
t.string "name"
t.references "essence", null: false, polymorphic: true, index: { unique: true }
t.references "element", null: false
end
end

unless table_exists?("alchemy_elements")
create_table "alchemy_elements", force: :cascade do |t|
create_table "alchemy_elements" do |t|
t.string "name"
t.integer "position"
t.references "page", null: false, index: false
t.boolean "public", default: true
t.boolean "folded", default: false
t.boolean "unique", default: false
t.timestamps null: false
t.timestamps
t.references "creator"
t.references "updater"
t.references "parent_element", index: false
Expand All @@ -44,27 +44,27 @@ def up
end

unless table_exists?("alchemy_elements_alchemy_pages")
create_table "alchemy_elements_alchemy_pages", id: false, force: :cascade do |t|
create_table "alchemy_elements_alchemy_pages", id: false do |t|
t.references "element"
t.references "page"
end
end

unless table_exists?("alchemy_essence_booleans")
create_table "alchemy_essence_booleans", force: :cascade do |t|
create_table "alchemy_essence_booleans" do |t|
t.boolean "value"
t.index ["value"], name: "index_alchemy_essence_booleans_on_value"
end
end

unless table_exists?("alchemy_essence_dates")
create_table "alchemy_essence_dates", force: :cascade do |t|
create_table "alchemy_essence_dates" do |t|
t.datetime "date"
end
end

unless table_exists?("alchemy_essence_files")
create_table "alchemy_essence_files", force: :cascade do |t|
create_table "alchemy_essence_files" do |t|
t.references "attachment"
t.string "title"
t.string "css_class"
Expand All @@ -73,13 +73,13 @@ def up
end

unless table_exists?("alchemy_essence_htmls")
create_table "alchemy_essence_htmls", force: :cascade do |t|
create_table "alchemy_essence_htmls" do |t|
t.text "source"
end
end

unless table_exists?("alchemy_essence_links")
create_table "alchemy_essence_links", force: :cascade do |t|
create_table "alchemy_essence_links" do |t|
t.string "link"
t.string "link_title"
t.string "link_target"
Expand All @@ -88,13 +88,13 @@ def up
end

unless table_exists?("alchemy_essence_pages")
create_table "alchemy_essence_pages", force: :cascade do |t|
create_table "alchemy_essence_pages" do |t|
t.references "page"
end
end

unless table_exists?("alchemy_essence_pictures")
create_table "alchemy_essence_pictures", force: :cascade do |t|
create_table "alchemy_essence_pictures" do |t|
t.references "picture"
t.string "caption"
t.string "title"
Expand All @@ -111,22 +111,22 @@ def up
end

unless table_exists?("alchemy_essence_richtexts")
create_table "alchemy_essence_richtexts", force: :cascade do |t|
create_table "alchemy_essence_richtexts" do |t|
t.text "body"
t.text "stripped_body"
t.boolean "public"
end
end

unless table_exists?("alchemy_essence_selects")
create_table "alchemy_essence_selects", force: :cascade do |t|
create_table "alchemy_essence_selects" do |t|
t.string "value"
t.index ["value"], name: "index_alchemy_essence_selects_on_value"
end
end

unless table_exists?("alchemy_essence_texts")
create_table "alchemy_essence_texts", force: :cascade do |t|
create_table "alchemy_essence_texts" do |t|
t.text "body"
t.string "link"
t.string "link_title"
Expand All @@ -137,7 +137,7 @@ def up
end

unless table_exists?("alchemy_folded_pages")
create_table "alchemy_folded_pages", force: :cascade do |t|
create_table "alchemy_folded_pages" do |t|
t.references "page", null: false, index: false
t.references "user", null: false, index: false
t.boolean "folded", default: false
Expand All @@ -146,13 +146,13 @@ def up
end

unless table_exists?("alchemy_languages")
create_table "alchemy_languages", force: :cascade do |t|
create_table "alchemy_languages" do |t|
t.string "name"
t.string "language_code"
t.string "frontpage_name"
t.string "page_layout", default: "intro"
t.boolean "public", default: false
t.timestamps null: false
t.timestamps
t.references "creator"
t.references "updater"
t.boolean "default", default: false
Expand All @@ -165,16 +165,16 @@ def up
end

unless table_exists?("alchemy_legacy_page_urls")
create_table "alchemy_legacy_page_urls", force: :cascade do |t|
create_table "alchemy_legacy_page_urls" do |t|
t.string "urlname", null: false
t.references "page", null: false
t.timestamps null: false
t.timestamps
t.index ["urlname"], name: "index_alchemy_legacy_page_urls_on_urlname"
end
end

unless table_exists?("alchemy_nodes")
create_table "alchemy_nodes", force: :cascade do |t|
create_table "alchemy_nodes" do |t|
t.string "name"
t.string "title"
t.string "url"
Expand All @@ -189,15 +189,15 @@ def up
t.references "language", null: false
t.references "creator"
t.references "updater"
t.timestamps null: false
t.timestamps
t.references "site", null: false
t.index ["lft"], name: "index_alchemy_nodes_on_lft"
t.index ["rgt"], name: "index_alchemy_nodes_on_rgt"
end
end

unless table_exists?("alchemy_pages")
create_table "alchemy_pages", force: :cascade do |t|
create_table "alchemy_pages" do |t|
t.string "name"
t.string "urlname"
t.string "title"
Expand All @@ -217,7 +217,7 @@ def up
t.boolean "robot_follow", default: true
t.boolean "sitemap", default: true
t.boolean "layoutpage", default: false
t.timestamps null: false
t.timestamps
t.references "creator"
t.references "updater"
t.references "language"
Expand All @@ -234,12 +234,12 @@ def up
end

unless table_exists?("alchemy_pictures")
create_table "alchemy_pictures", force: :cascade do |t|
create_table "alchemy_pictures" do |t|
t.string "name"
t.string "image_file_name"
t.integer "image_file_width"
t.integer "image_file_height"
t.timestamps null: false
t.timestamps
t.references "creator"
t.references "updater"
t.string "upload_hash"
Expand All @@ -250,10 +250,10 @@ def up
end

unless table_exists?("alchemy_sites")
create_table "alchemy_sites", force: :cascade do |t|
create_table "alchemy_sites" do |t|
t.string "host"
t.string "name"
t.timestamps null: false
t.timestamps
t.boolean "public", default: false
t.text "aliases"
t.boolean "redirect_to_primary_host"
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200423073425_create_alchemy_essence_nodes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateAlchemyEssenceNodes < ActiveRecord::Migration[5.2]
class CreateAlchemyEssenceNodes < ActiveRecord::Migration[6.0]
def change
create_table :alchemy_essence_nodes do |t|
t.references "node"
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200504210159_remove_site_id_from_nodes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
class RemoveSiteIdFromNodes < ActiveRecord::Migration[5.2]
class RemoveSiteIdFromNodes < ActiveRecord::Migration[6.0]
def up
remove_foreign_key :alchemy_nodes, :alchemy_sites
remove_index :alchemy_nodes, :site_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class AddLanguageIdForeignKeyToAlchemyPages < ActiveRecord::Migration[5.2]
class AddLanguageIdForeignKeyToAlchemyPages < ActiveRecord::Migration[6.0]
def change
add_foreign_key :alchemy_pages, :alchemy_languages, column: :language_id
change_column_null :alchemy_pages, :language_id, false, Alchemy::Language.default&.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
class AddMenuTypeToAlchemyNodes < ActiveRecord::Migration[5.2]
class AddMenuTypeToAlchemyNodes < ActiveRecord::Migration[6.0]
class LocalNode < ActiveRecord::Base
self.table_name = :alchemy_nodes
acts_as_nested_set scope: :language_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
class MakePageLayoutpageNullFalse < ActiveRecord::Migration[5.2]
class MakePageLayoutpageNullFalse < ActiveRecord::Migration[6.0]
def change
change_column_null :alchemy_pages, :layoutpage, false, false
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
class RemoveVisibleFromAlchemyPages < ActiveRecord::Migration[5.2]
class RemoveVisibleFromAlchemyPages < ActiveRecord::Migration[6.0]
class LocalPage < ActiveRecord::Base
self.table_name = "alchemy_pages"

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200617110713_create_alchemy_picture_thumbs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreateAlchemyPictureThumbs < ActiveRecord::Migration[5.2]
class CreateAlchemyPictureThumbs < ActiveRecord::Migration[6.0]
def up
return if table_exists?(:alchemy_picture_thumbs)

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200907111332_remove_tri_state_booleans.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class RemoveTriStateBooleans < ActiveRecord::Migration[5.2]
class RemoveTriStateBooleans < ActiveRecord::Migration[6.0]
def change
change_column_null :alchemy_elements, :public, false, false
change_column_default :alchemy_elements, :public, true
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20201207131309_create_page_versions.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class CreatePageVersions < ActiveRecord::Migration[5.2]
class CreatePageVersions < ActiveRecord::Migration[6.0]
def change
create_table :alchemy_page_versions do |t|
t.references :page,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class AddPageVersionIdToAlchemyElements < ActiveRecord::Migration[5.2]
class AddPageVersionIdToAlchemyElements < ActiveRecord::Migration[6.0]
class LocalPage < ActiveRecord::Base
self.table_name = :alchemy_pages
has_many :elements, class_name: "LocalElement", inverse_of: :page
Expand Down
Loading

0 comments on commit c08916d

Please sign in to comment.