Rename Tag to Theme across code and schema

Rename the endgame-label concept from Tag to Theme to match the glossary:
the context becomes Chesstrainer.Themes, the schema Chesstrainer.Themes.Theme,
and the Endgame association is :themes. The category enum
(endgame/opening/tactic) is preserved.

Rewrite the original migrations in place so themes / endgames_themes
(with theme_id) are created directly, instead of adding a transition
migration.

Closes #12
This commit is contained in:
2026-11-02 09:14:17 +01:00
parent 645f65f2a3
commit cd2e7f0164
21 changed files with 387 additions and 382 deletions
+4 -4
View File
@@ -12,7 +12,7 @@
alias Chesstrainer.Repo
alias Chesstrainer.Endgames.Endgame
alias Chesstrainer.Tags.Tag
alias Chesstrainer.Themes.Theme
now = DateTime.utc_now() |> DateTime.truncate(:second)
@@ -49,7 +49,7 @@ Repo.insert_all(
IO.puts("✅ Done seeding endgames.")
IO.puts("🌱 Seeding endgame tags into DB...")
IO.puts("🌱 Seeding endgame themes into DB...")
theme_names = [
"mate in 2",
@@ -62,11 +62,11 @@ theme_names = [
]
Repo.insert_all(
Tag,
Theme,
Enum.map(theme_names, fn name ->
%{name: name, category: :endgame, inserted_at: now, updated_at: now}
end),
on_conflict: :nothing
)
IO.puts("✅ Done seeding endgame tags.")
IO.puts("✅ Done seeding endgame themes.")