From 3d5f060b53aba8c4c0b470ebfb630f536327c8ec Mon Sep 17 00:00:00 2001 From: Dzejkobik007 Date: Mon, 10 Oct 2022 00:08:57 +0200 Subject: [PATCH] add movies --- si/movies/json.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++ si/movies/yaml.md | 2 ++ 2 files changed, 89 insertions(+) diff --git a/si/movies/json.md b/si/movies/json.md index b0684c1..df26600 100644 --- a/si/movies/json.md +++ b/si/movies/json.md @@ -1,7 +1,94 @@ # Movies - json +# Movies - json +## Popis + +Struktura souboru json pro import/export z/do database movies + +### movie +- id +- name +- year +- country_id + +### country +- id +- name + +### movie_has_genre +- movie_id +- genre_id + +### genre +- id +- name + +## Rozbor + +```mermaid +graph TD; + movie-->movie_has_genre; + movie_has_genre-->genre; + movie-->country; +``` + +## EXAMPLE: +```json +{ + "movie": [ + { + "id": 1, + "name": "Harry Potter a Fénixův řád", + "year": 2007, + "country_id": 2 + }, + { + "id": 2, + "name": "Hostitel", + "year": 2013, + "country_id": 1 + } + ], + "country": [ + { + "id":1, + "name":"USA" + }, + { + "id":2, + "name":"Velká Británie" + } + ], + "movie_has_genre": [ + { + "movie_id": 2, + "genre_id": 1 + }, + { + "movie_id": 2, + "genre_id": 2 + }, + { + "movie_id": 1, + "genre_id": 2 + } + ], + "genre": [ + { + "id":1, + "name":"Thriller" + }, + { + "id":2, + "name":"Fantazy" + } + ] +} +``` ## Popis +Struktura souboru json pro import/export z/do database movies + ### movie - id - name diff --git a/si/movies/yaml.md b/si/movies/yaml.md index 1f615ad..4f6c715 100644 --- a/si/movies/yaml.md +++ b/si/movies/yaml.md @@ -2,6 +2,8 @@ ## Popis +Struktura souboru yaml pro import/export z/do database movies + ### movie - id - name