Feat: Add hierarchical category support for menu organization

Added parent-child relationship to categories, allowing organization
of categories into submenus (e.g., Apparel > Adults, Kids, Babies).

Changes:
- Add parentId field to Category model
- Create foreign key relationship for category hierarchy
- Update homepage to query only top-level categories (parentId = null)
- Include children categories for future use in category menus

Database migration:
- Adds parentId column to Category table
- Sets up CASCADE delete to remove children when parent is deleted

This enables menu structure like:
  Apparel
    - Adults
    - Kids
    - Babies
  Drinkware
  Phone Cases
  etc.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-21 17:48:09 +01:00
co-authored by Claude Haiku 4.5
parent 86df5a6cf0
commit 23631b1bce
4 changed files with 19 additions and 2 deletions
+8 -1
View File
@@ -135,7 +135,14 @@
"Bash(GIT_TRACE=1 git push origin main --force)",
"Bash(pkill -f \"node.exe\")",
"PowerShell(Stop-Process -Name node -Force -ErrorAction SilentlyContinue)",
"Bash(find \"D:\\\\Craft2Prints\\\\src\\\\app\" -path \"*/\\\\[slug\\\\]/*\" -name \"page.tsx\" | head -10)"
"Bash(find \"D:\\\\Craft2Prints\\\\src\\\\app\" -path \"*/\\\\[slug\\\\]/*\" -name \"page.tsx\" | head -10)",
"Read(//c/Users/Lyons/OneDrive/Desktop/Products/AWD T Shirts/**)",
"Read(//c/Users/Lyons/OneDrive/Desktop/Products/**)",
"Bash(mv AT001B_* \"Polo T Shirts/\")",
"Bash(mv AT001M_* \"Polo T Shirts/\")",
"Bash(mv AT002B_* \"Striped collar/\")",
"Bash(mv AT002M_* \"Striped collar/\")",
"Bash(cd \"/c/Users/Lyons/OneDrive/Desktop/Products/AWD T Shirts\" *)"
]
}
}