commit 41eaf44149edb1291f916481585673d1ed46a363
Author: Adam Mištera <amistera@students.zcu.cz>
Date:   Sun Mar 22 17:59:41 2020 +0100

    Issue #7692 @1h
    
    [+] Dokončení modelu, úprava readme.

diff --git a/README.md b/README.md
index efbf6fe..57cc6c2 100644
--- a/README.md
+++ b/README.md
@@ -20,3 +20,8 @@
 1. Zajistěte databázi se spojením určeným v souboru `.env`.
 2. Spusťte v terminálu (PHPStorm nebo cmd ve složce projektu) příkaz `php artisan migrate`.
 
+###### SQLite databáze
+
+1. Soubor SQLite datábaze umístěte do `database\database.sqlite` (může to být i nový prázdný soubor).
+2. Pro připojení k databázi je v potřeba v souboru `.env` nastavit `DB_CONNECTION=sqlite` (ostatní nastavení pro databázi odstranit).
+3. Pro **čistou** migraci spusťte příkaz `php artisan migrate:fresh`.
diff --git a/database/migrations/2020_03_20_000000_CreateArtefactsTable.php b/database/migrations/2020_03_20_000000_CreateArtefactsTable.php
new file mode 100644
index 0000000..d79270e
--- /dev/null
+++ b/database/migrations/2020_03_20_000000_CreateArtefactsTable.php
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateArtefactsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('artefacts', function (Blueprint $table) {
+            $table->id();
+            $table->string('name');
+            $table->string('author');
+            $table->string('made_in');
+            $table->string('publisher');
+            $table->integer('year');
+            $table->integer('pages');
+            $table->integer('likes');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('artefacts');
+    }
+}
diff --git a/database/migrations/2020_03_20_000000_create_artefacts_table.php b/database/migrations/2020_03_20_000000_create_artefacts_table.php
deleted file mode 100644
index d79270e..0000000
--- a/database/migrations/2020_03_20_000000_create_artefacts_table.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateArtefactsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('artefacts', function (Blueprint $table) {
-            $table->id();
-            $table->string('name');
-            $table->string('author');
-            $table->string('made_in');
-            $table->string('publisher');
-            $table->integer('year');
-            $table->integer('pages');
-            $table->integer('likes');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('artefacts');
-    }
-}
diff --git a/database/migrations/2020_03_22_000000_CreateArtefactCategoryTable.php b/database/migrations/2020_03_22_000000_CreateArtefactCategoryTable.php
new file mode 100644
index 0000000..8aa29e9
--- /dev/null
+++ b/database/migrations/2020_03_22_000000_CreateArtefactCategoryTable.php
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateArtefactCategoryTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('artefact_category', function (Blueprint $table) {
+            $table->unsignedBigInteger('artefact_id');
+            $table->unsignedBigInteger('category_id');
+            $table->foreign('artefact_id')->references('id')->on('artefacts');
+            $table->foreign('category_id')->references('id')->on('categories');
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('artefact_category');
+    }
+}
