From bb74b451d60327727dfa1a262f4229966fb93b8c Mon Sep 17 00:00:00 2001 From: tomit4 Date: Fri, 3 Sep 2021 04:23:25 -0700 Subject: [PATCH] notes on database relations --- db_relations_notes.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db_relations_notes.txt diff --git a/db_relations_notes.txt b/db_relations_notes.txt new file mode 100644 index 00000000..6b25d47f --- /dev/null +++ b/db_relations_notes.txt @@ -0,0 +1,19 @@ +# Taken from Tom Nurkkala's Youtube Video on Object-RElational Mapping, which uses KnexJS and ObjectionJS to demonstrate +# Basic SQL relationships + +Models in relation + source: model containing relationMappings definition + related: model at other end of relation + +Relation Attribute FK(s) in +One-toMany BelongsToOneRelation Source + HasManyRelation Related + +Many-to-Many ManyToManyRelation Source + +One-to-One BelongsToOneRelation Source + HasOneRelation Related + HasOneThroughRelation Join table + +See video at around 48:00 for further details. +Also look up Database Relations and also ObjectionJS docs for further details on each one.