defmodule GitGud.Repo.Migrations.FixEditorThemeIds do
use Ecto.Migration
@moduledoc """
Maps editor_theme values from the original (incorrect) curated names
to the real Lumis ids. Necessary because the slice 26 curated list
shipped with several theme names Lumis doesn't actually expose, so
those rows silently fell back to onedark at render time.
"""
def up do
fixes = [
{"solarized_dark", "neosolarized_dark"},
{"solarized_light", "neosolarized_light"},
{"tokyonight", "tokyonight_storm"},
{"rose_pine", "rosepine_dark"}
]
for {old, new} <- fixes do
execute("""
UPDATE users
SET editor_theme = '#{new}'
WHERE editor_theme = '#{old}'
""")
end
end
def down do
:ok
end
end
772 B · text
5af55d9