Add sub-categories to affirmation categories
Add self-referential parent/child relation on AffirmationCategory for one-level hierarchy. Update AffirmationForm with two-level category and sub-category dropdowns, server actions with find-or-create hierarchy logic, AffirmationList with Parent
This commit is contained in:
@@ -128,8 +128,11 @@ model SolfeggioFrequency {
|
||||
}
|
||||
|
||||
model AffirmationCategory {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
parentId Int?
|
||||
parent AffirmationCategory? @relation("CategoryHierarchy", fields: [parentId], references: [id])
|
||||
children AffirmationCategory[] @relation("CategoryHierarchy")
|
||||
affirmations Affirmation[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user