notes on database relations
This commit is contained in:
parent
713263c7b2
commit
bb74b451d6
1 changed files with 19 additions and 0 deletions
19
db_relations_notes.txt
Normal file
19
db_relations_notes.txt
Normal file
|
|
@ -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.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue