Emi Matchu
9f74e6020e
Previously we did this hackily by comparing the ID to a hardcoded list of IDs, but I think putting this in the database is clearer and more robust, and it should also help with our upcoming item search stuff that will filter by it!
18 lines
695 B
Ruby
18 lines
695 B
Ruby
class AddSeriesNameToAltStyles < ActiveRecord::Migration[7.1]
|
|
def change
|
|
add_column :alt_styles, :series_name, :string, null: false,
|
|
default: "<New?>"
|
|
|
|
reversible do |direction|
|
|
direction.up do
|
|
# These IDs are determined by Neopets.com, so referencing them like
|
|
# this should be relatively stable! Backfill the series name
|
|
# "Nostalgic" for all alt styles in the Nostalgic ID range. (At time
|
|
# of writing, *all* alt styles are Nostalgic, but I'm writing it like
|
|
# this for clarity and future-proofing!)
|
|
AltStyle.where("id >= 87249 AND id <= 87503").update_all(
|
|
series_name: "Nostalgic")
|
|
end
|
|
end
|
|
end
|
|
end
|