Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class ChangeBodyNullableOnRhinoBodyModels < ActiveRecord::Migration[8.1]
def up
change_column_null :story_ideas, :body, true
change_column_null :stories, :body, true
change_column_null :community_news, :body, true
change_column_null :resources, :body, true
change_column_null :tutorials, :body, true
change_column_null :workshop_variation_ideas, :body, true
change_column_null :workshop_variations, :body, true
end

def down
%i[story_ideas stories community_news resources tutorials workshop_variation_ideas workshop_variations].each do |table|
ActiveRecord::Base.connection.execute("UPDATE #{table} SET body = '' WHERE body IS NULL")
change_column_null table, :body, false
end
end
end
16 changes: 8 additions & 8 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.1].define(version: 2026_02_18_203619) do
ActiveRecord::Schema[8.1].define(version: 2026_02_19_144255) do
create_table "action_text_mentions", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.bigint "action_text_rich_text_id", null: false
t.datetime "created_at", null: false
Expand Down Expand Up @@ -362,7 +362,7 @@

create_table "community_news", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.integer "author_id", null: false
t.text "body", size: :medium
t.text "body", size: :medium, null: true
t.datetime "created_at", null: false
t.integer "created_by_id", null: false
t.boolean "featured"
Expand Down Expand Up @@ -769,7 +769,7 @@
create_table "resources", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "agency"
t.string "author"
t.text "body", size: :long
t.text "body", size: :long, null: true
t.datetime "created_at", precision: nil, null: false
t.boolean "featured", default: false
t.boolean "female", default: false
Expand Down Expand Up @@ -815,7 +815,7 @@
end

create_table "stories", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.text "body", size: :medium
t.text "body", size: :medium, null: true
t.datetime "created_at", null: false
t.integer "created_by_id", null: false
t.string "external_workshop_title"
Expand Down Expand Up @@ -845,7 +845,7 @@
end

create_table "story_ideas", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.text "body", size: :medium
t.text "body", size: :medium, null: true
t.datetime "created_at", null: false
t.integer "created_by_id", null: false
t.string "external_workshop_title"
Expand All @@ -866,7 +866,7 @@
end

create_table "tutorials", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.text "body"
t.text "body", null: true
t.datetime "created_at", null: false
t.boolean "featured", default: false, null: false
t.integer "position", default: 10, null: false
Expand Down Expand Up @@ -1097,7 +1097,7 @@
end

create_table "workshop_variation_ideas", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.text "body", size: :long
t.text "body", size: :long, null: true
t.datetime "created_at", null: false
t.integer "created_by_id", null: false
t.string "name", null: false
Expand All @@ -1119,7 +1119,7 @@
end

create_table "workshop_variations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.text "body", size: :long
t.text "body", size: :long, null: true
t.datetime "created_at", precision: nil, null: false
t.integer "created_by_id"
t.boolean "inactive", default: true
Expand Down