{"format":"epicdraw-workspace","version":1,"charts":[{"id":"template-online-shop-er-diagram","name":"ER diagram for an online shopping system","paper":"white","pattern":"blank","wobble":0.22,"ppm":48,"nodes":[{"id":"online-shop-er-diagram-n1","type":"lane","text":"","x":0,"y":0,"w":1720,"h":1240,"fill":"none","fst":"solid","seed":701,"font":"sans","fs":22,"bold":false,"lv":0,"lock":true,"z":-20,"ink":"navy"},{"id":"online-shop-er-diagram-n2","type":"text","text":"ER diagram for an online shopping system","x":42,"y":24,"w":1620,"h":64,"fill":"none","fst":"solid","seed":702,"font":"hand","fs":48,"bold":true,"lv":0,"align":"left","ink":"navy"},{"id":"online-shop-er-diagram-n3","type":"text","text":"Model customers, orders, products and payments with primary keys, foreign keys and cardinality.","x":42,"y":96,"w":1620,"h":44,"fill":"none","fst":"solid","seed":703,"font":"sans","fs":23,"bold":false,"lv":0,"align":"left","ink":"grey"},{"id":"online-shop-er-diagram-n4","type":"line","text":"","x":42,"y":160,"w":1636,"h":4,"fill":"none","fst":"solid","seed":704,"font":"sans","fs":22,"bold":false,"lv":0,"rot":0,"head":"none","ink":"navy"},{"id":"online-shop-er-diagram-n5","type":"text","text":"EXAMPLE TEMPLATE · Replace the example content, owners and dates with your own.","x":42,"y":1192,"w":1630,"h":30,"fill":"none","fst":"solid","seed":705,"font":"sans","fs":18,"bold":false,"lv":0,"align":"left","ink":"grey"},{"id":"online-shop-er-diagram-n6","type":"table","text":"","x":45,"y":215,"w":330,"h":210,"fill":"sky","fst":"solid","seed":706,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["customer","Key"],["customer_id","PK"],["email","unique"],["first_name",""],["last_name",""],["created_at",""]]},{"id":"online-shop-er-diagram-n7","type":"table","text":"","x":485,"y":215,"w":330,"h":210,"fill":"sun","fst":"solid","seed":707,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["order","Key"],["order_id","PK"],["customer_id","FK"],["status",""],["total_amount",""],["placed_at",""]]},{"id":"online-shop-er-diagram-n8","type":"table","text":"","x":925,"y":215,"w":330,"h":210,"fill":"sun","fst":"solid","seed":708,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["order_item","Key"],["order_item_id","PK"],["order_id","FK"],["variant_id","FK"],["quantity",""],["unit_price",""]]},{"id":"online-shop-er-diagram-n9","type":"table","text":"","x":1345,"y":215,"w":330,"h":210,"fill":"lavender","fst":"solid","seed":709,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["product_variant","Key"],["variant_id","PK"],["product_id","FK"],["sku","unique"],["size, colour",""],["stock_qty",""]]},{"id":"online-shop-er-diagram-n10","type":"table","text":"","x":45,"y":560,"w":330,"h":210,"fill":"sky","fst":"solid","seed":710,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["address","Key"],["address_id","PK"],["customer_id","FK"],["line_1, city",""],["postcode",""],["country",""]]},{"id":"online-shop-er-diagram-n11","type":"table","text":"","x":485,"y":560,"w":330,"h":210,"fill":"mint","fst":"solid","seed":711,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["payment","Key"],["payment_id","PK"],["order_id","FK"],["method",""],["amount",""],["status",""]]},{"id":"online-shop-er-diagram-n12","type":"table","text":"","x":925,"y":560,"w":330,"h":210,"fill":"mint","fst":"solid","seed":712,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["shipment","Key"],["shipment_id","PK"],["order_id","FK"],["address_id","FK"],["carrier",""],["tracking_no",""]]},{"id":"online-shop-er-diagram-n13","type":"table","text":"","x":1345,"y":560,"w":330,"h":210,"fill":"lavender","fst":"solid","seed":713,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["product","Key"],["product_id","PK"],["category_id","FK"],["title",""],["description",""],["base_price",""]]},{"id":"online-shop-er-diagram-n14","type":"table","text":"","x":1345,"y":905,"w":330,"h":176,"fill":"peach","fst":"solid","seed":714,"font":"sans","fs":19,"bold":false,"lv":0,"rows":[["category","Key"],["category_id","PK"],["parent_id","FK"],["name",""],["slug","unique"]]},{"id":"online-shop-er-diagram-n24","type":"lane","text":"","x":45,"y":905,"w":600,"h":200,"fill":"none","fst":"solid","seed":724,"font":"sans","fs":22,"bold":false,"lv":0,"z":-1},{"id":"online-shop-er-diagram-n25","type":"rect","text":"How to read it","x":45,"y":905,"w":600,"h":56,"fill":"white","fst":"solid","seed":725,"font":"sans","fs":24,"bold":true,"lv":0},{"id":"online-shop-er-diagram-n26","type":"text","text":"PK: primary key · FK: foreign key\n1 : N: one row links to many rows\nDashed: optional link","x":63,"y":975,"w":564,"h":118,"fill":"none","fst":"solid","seed":726,"font":"sans","fs":21,"bold":false,"lv":0,"align":"left"},{"id":"online-shop-er-diagram-n27","type":"lane","text":"","x":685,"y":905,"w":600,"h":200,"fill":"none","fst":"solid","seed":727,"font":"sans","fs":22,"bold":false,"lv":0,"z":-1},{"id":"online-shop-er-diagram-n28","type":"rect","text":"Design decisions","x":685,"y":905,"w":600,"h":56,"fill":"sun","fst":"solid","seed":728,"font":"sans","fs":24,"bold":true,"lv":0},{"id":"online-shop-er-diagram-n29","type":"text","text":"Price is copied to order_item, so old\norders keep the price paid. Stock\nlives on the variant, not the product.","x":703,"y":975,"w":564,"h":118,"fill":"none","fst":"solid","seed":729,"font":"sans","fs":21,"bold":false,"lv":0,"align":"left"}],"edges":[{"id":"online-shop-er-diagram-e15","from":"online-shop-er-diagram-n6","to":"online-shop-er-diagram-n7","label":"1 : N","seed":715,"style":"straight","head":"end","lv":0,"font":"sans","fs":18,"sa":"r","ea":"l"},{"id":"online-shop-er-diagram-e16","from":"online-shop-er-diagram-n7","to":"online-shop-er-diagram-n8","label":"1 : N","seed":716,"style":"straight","head":"end","lv":0,"font":"sans","fs":18,"sa":"r","ea":"l"},{"id":"online-shop-er-diagram-e17","from":"online-shop-er-diagram-n8","to":"online-shop-er-diagram-n9","label":"N : 1","seed":717,"style":"straight","head":"end","lv":0,"font":"sans","fs":18,"sa":"r","ea":"l"},{"id":"online-shop-er-diagram-e18","from":"online-shop-er-diagram-n6","to":"online-shop-er-diagram-n10","label":"1 : N","seed":718,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"b","ea":"t"},{"id":"online-shop-er-diagram-e19","from":"online-shop-er-diagram-n7","to":"online-shop-er-diagram-n11","label":"1 : N","seed":719,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"b","ea":"t"},{"id":"online-shop-er-diagram-e20","from":"online-shop-er-diagram-n7","to":"online-shop-er-diagram-n12","label":"1 : N","seed":720,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"b","ea":"t"},{"id":"online-shop-er-diagram-e21","from":"online-shop-er-diagram-n13","to":"online-shop-er-diagram-n9","label":"1 : N","seed":721,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"t","ea":"b"},{"id":"online-shop-er-diagram-e22","from":"online-shop-er-diagram-n14","to":"online-shop-er-diagram-n13","label":"1 : N","seed":722,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"t","ea":"b"},{"id":"online-shop-er-diagram-e23","from":"online-shop-er-diagram-n10","to":"online-shop-er-diagram-n12","label":"ships to","seed":723,"style":"elbow","head":"end","lv":0,"font":"sans","fs":18,"sa":"b","ea":"b","dash":true}],"strokes":[],"imgs":{}}],"cur":"template-online-shop-er-diagram"}