So I haven’t used the UI to create multi references or subtables. It’s using what I already made manually.
It looks a bit confusing, probably due to my own naming convention mixing with wappler’s logic…
How can I make it look like intended?
I think I need to rename my tables… So what is the naming convention that matches with Wappler’s implementation of the database manager?
Example: I have the following structure (these are all many to many)… schools → courses → chapters → lectures.
In plain words: a school can have multiple courses, but a course can be part of multiple schools.
A course can have multiple chapters, each chapter can be part of multiple courses.
A chapter can have multiple lectures, each lecture can be part of multiple chapters.
Is this how I should make it using the UI? ↓
Create 4 tables: schoolscourseschapterslectures
Go from top down and add multi references: for example, in schools we add schools_courses
Then in courses we add courses_chapters etc.?
Thanks @George - trying to understand the concept completely:
Is the following correct? Wappler looks at the prefix and references to decide if it’s a subtable or multi ref table:
Subtable: main table users and users_contactinfo (with ref to users.id) this users_contactinfo will become a subtable of users in Wappler
Multiref: 3 tables… courses, schools and schools_courses (with 2 refs: courses.id and schools.id) this will become a multi ref table in wappler, visible under the schools table because it’s prefixed with ‘schools’
No, users_contactinfo will become sub table of users that is named just contactinfo
multi reference are actually exact the same as sub tables but they just contain 2 reference keys inside - one to the parent and one to the other table. That makes a junction table. For the naming of multi reference tables - is the same as with sub tables. It is prefixed with the parent table name.
So in your case the courses_chapters junction table will become under courses just chapters
And the schools_courses under schools will become just courses
Once you see that relation - it will all make sense