mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
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:
+4
-4
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user