docs
docs copied to clipboard
Add information about creating tables with parent-children relations
I've added some information about creating tables with parent-children relationships. Specifically pointing out a common mistake about creating tables at the same time which contain a reference, and emphasizing that parents don't have a column for their children.
When I was creating my first tables, I ran into this error, which, after I resolved it, prompted this PR:
[ WARNING ] server: relation "table_name" does not exist (RangeVarGetRelidExtended)
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: server: relation "table_name" does not exist (RangeVarGetRelidExtended)
and then later this:
server: null value in column "child_ids" of relation "parent" violates not-null constraint
I'm new to Vapor/Fluent so let me know if this info is not good guidance/not correct. Let me know what you'd like changed.