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,7 +4,7 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
alias Chesstrainer.Endgames
alias Chesstrainer.Game
alias Chesstrainer.Repo
alias Chesstrainer.Tags
alias Chesstrainer.Themes
import ChesstrainerWeb.Board.BoardComponent
@@ -52,7 +52,7 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
<:item title="Message">{@endgame.message}</:item>
<:item title="Notes">{@endgame.notes}</:item>
<:item title="Result">{@endgame.result}</:item>
<:item title="Themes">{Enum.join(Tags.names(@endgame.tags), ", ")}</:item>
<:item title="Themes">{Enum.join(Themes.names(@endgame.themes), ", ")}</:item>
<:item title="Attempted">{@endgame.times_attempted}</:item>
<:item title="Solved">{@endgame.times_solved}</:item>
</.list>
@@ -65,6 +65,6 @@ defmodule ChesstrainerWeb.EndgameLive.Show do
{:ok,
socket
|> assign(:page_title, "Show Endgame")
|> assign(:endgame, Endgames.get_endgame!(id) |> Repo.preload(:tags))}
|> assign(:endgame, Endgames.get_endgame!(id) |> Repo.preload(:themes))}
end
end