impress/db/migrate/20240227233743_change_default_for_alt_styles_series_name.rb
Emi Matchu 18c7a34b8f Update series_name for alt styles to be null, with a fallback string
I considered this at first, but decided to keep it simple until it
turned out to matter. Oops, it already matters, lol!

I want the item search code to be able to easily tell if the series
name is real or a placeholder, so we can decide whether to build the
filter text in `fits:$series-$color-$species` form or
`fits:alt-style-$id` form.

So in this change, we keep it that `AltStyle#series_name` returns the
placeholder string if none is set, but callers can explicitly ask
whether it's a real series name or not. Will use this in our next
change!
2024-02-27 15:48:28 -08:00

6 lines
228 B
Ruby

class ChangeDefaultForAltStylesSeriesName < ActiveRecord::Migration[7.1]
def change
change_column_null :alt_styles, :series_name, true
change_column_default :alt_styles, :series_name, from: "<New?>", to: nil
end
end