impress/db/migrate/20240502195157_fix_default_value_for_items_description.rb
Matchu 0943e2dbba Fix broken default value in schema for item description
Idk how we got into this state, or if it's environment-dependent or
MySQL-version-dependent or what, but setting up the dev environment on
my macOS machine is complaining that `TEXT` columns can't have default
values.

Well, in that case, let's just have it be a non-nullable field, and add
a note to our code that missing fields *can* cause item saving to fail!
(This was always true, but I'm just extra-noting it because it's
becoming *more* true.)
2024-05-02 13:00:10 -07:00

8 lines
375 B
Ruby

class FixDefaultValueForItemsDescription < ActiveRecord::Migration[7.1]
def change
# Idk why, but this column's default value is specified in our schema as
# an empty string, but setting up the dev environment on my macOS machine
# is saying on latest MariaDB that this isn't allowed.
change_column_default :items, :description, from: "", to: nil
end
end