commit 8e9897d4d2b923e0422d1dbe17ad6cc1a5468e79
Author: zabran <zabran@students.zcu.cz>
Date:   Sat Mar 21 00:41:38 2020 +0100

    Issue #7692 @3h
    Otestování datového modelu a vypracování návodu pro vytvoření databáze.

diff --git a/README.md b/README.md
index 01b57d8..efbf6fe 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Aplikace pro muzea - MERLOT
 
-Jak zprovoznit projekt:
+###### Jak zprovoznit projekt:
 
 1. Stáhněte **PHPStorm** (zdarma přes školní licenci), **PHP** (ideálně verze 7.4 a výš, minimálně verze 7.2.5) a **Composer**. Všechny tyto nainstalujte (PHP se neinstaluje).
 2. Ve složce s PHP přejmenujte _php.ini-developement_ na _php.ini_ a v souboru odkomentujte všechny extension kromě _ffi_, _ftp_, _mbstring_, _exif_, _oci8_12c_, _openssl_, _pdo_firebird_, _pdo_oci_.
@@ -14,3 +14,9 @@ Jak zprovoznit projekt:
     3. `php artisan key:generate`
 8. V PHPStorm v **Run/Edit Configurations** přidejte **PHP Build-in Web Server** , jeho _document root_ je složka projektu a _use router script_ ukazuje na **server.php** ve stejné složce.
 9. Spusťte projekt projekt. Na localhost by vám měl vyjet nápis **Laravel** s funkčním menu.
+
+###### Jak zprovoznit databázi:
+
+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`.
+
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index ee8ca5b..327b8e7 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -3,6 +3,7 @@
 namespace App\Providers;
 
 use Illuminate\Support\ServiceProvider;
+use Illuminate\Support\Facades\Schema;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -24,5 +25,6 @@ class AppServiceProvider extends ServiceProvider
     public function boot()
     {
         //
+        Schema::defaultStringLength(200);
     }
 }
diff --git a/config/database.php b/config/database.php
index b42d9b3..6786157 100644
--- a/config/database.php
+++ b/config/database.php
@@ -48,8 +48,8 @@ return [
             'url' => env('DATABASE_URL'),
             'host' => env('DB_HOST', '127.0.0.1'),
             'port' => env('DB_PORT', '3306'),
-            'database' => env('DB_DATABASE', 'forge'),
-            'username' => env('DB_USERNAME', 'forge'),
+            'database' => env('DB_DATABASE', 'mydb'),
+            'username' => env('DB_USERNAME', 'root'),
             'password' => env('DB_PASSWORD', ''),
             'unix_socket' => env('DB_SOCKET', ''),
             'charset' => 'utf8mb4',
diff --git a/database/migrations/.2014_10_12_000000_create_users_table.php b/database/migrations/.2014_10_12_000000_create_users_table.php
new file mode 100644
index 0000000..621a24e
--- /dev/null
+++ b/database/migrations/.2014_10_12_000000_create_users_table.php
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateUsersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('users', function (Blueprint $table) {
+            $table->id();
+            $table->string('name');
+            $table->string('email')->unique();
+            $table->timestamp('email_verified_at')->nullable();
+            $table->string('password');
+            $table->rememberToken();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('users');
+    }
+}
diff --git a/database/migrations/.2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/.2019_08_19_000000_create_failed_jobs_table.php
new file mode 100644
index 0000000..9bddee3
--- /dev/null
+++ b/database/migrations/.2019_08_19_000000_create_failed_jobs_table.php
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFailedJobsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('failed_jobs', function (Blueprint $table) {
+            $table->id();
+            $table->text('connection');
+            $table->text('queue');
+            $table->longText('payload');
+            $table->longText('exception');
+            $table->timestamp('failed_at')->useCurrent();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('failed_jobs');
+    }
+}
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
deleted file mode 100644
index 621a24e..0000000
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateUsersTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('users', function (Blueprint $table) {
-            $table->id();
-            $table->string('name');
-            $table->string('email')->unique();
-            $table->timestamp('email_verified_at')->nullable();
-            $table->string('password');
-            $table->rememberToken();
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('users');
-    }
-}
diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php
deleted file mode 100644
index 9bddee3..0000000
--- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateFailedJobsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('failed_jobs', function (Blueprint $table) {
-            $table->id();
-            $table->text('connection');
-            $table->text('queue');
-            $table->longText('payload');
-            $table->longText('exception');
-            $table->timestamp('failed_at')->useCurrent();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('failed_jobs');
-    }
-}
diff --git a/database/migrations/2020_03_20_000000_CreateCategoryTable.php b/database/migrations/2020_03_20_000000_CreateCategoryTable.php
new file mode 100644
index 0000000..4b268da
--- /dev/null
+++ b/database/migrations/2020_03_20_000000_CreateCategoryTable.php
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateCategoryTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('categories', function (Blueprint $table) {
+            $table->id();
+
+            $table->string('nameCZ');
+            $table->string('nameEN');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('categories');
+    }
+}
diff --git a/database/migrations/2020_03_20_000000_CreateMetadataTable.php b/database/migrations/2020_03_20_000000_CreateMetadataTable.php
new file mode 100644
index 0000000..3cbce77
--- /dev/null
+++ b/database/migrations/2020_03_20_000000_CreateMetadataTable.php
@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateMetadataTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('metadata', function (Blueprint $table) {
+            $table->id();
+            $table->integer('artefact_id')->unsigned();
+            $table->foreign('artefact_id')->references('id')->on('artefacts');
+
+            $table->string('name');
+            $table->longText('noteCZ');
+            $table->longText('noteEN');
+
+            $table->integer('page');
+            $table->integer('likes');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('metadata');
+    }
+}
diff --git a/database/migrations/2020_03_20_000000_create_artefacts_table.php b/database/migrations/2020_03_20_000000_create_artefacts_table.php
new file mode 100644
index 0000000..d79270e
--- /dev/null
+++ b/database/migrations/2020_03_20_000000_create_artefacts_table.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/CreateArtefactsTable.php b/database/migrations/CreateArtefactsTable.php
deleted file mode 100644
index d79270e..0000000
--- a/database/migrations/CreateArtefactsTable.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/CreateCategoryTable.php b/database/migrations/CreateCategoryTable.php
deleted file mode 100644
index 4b268da..0000000
--- a/database/migrations/CreateCategoryTable.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateCategoryTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('categories', function (Blueprint $table) {
-            $table->id();
-
-            $table->string('nameCZ');
-            $table->string('nameEN');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('categories');
-    }
-}
diff --git a/database/migrations/CreateMetadataTable.php b/database/migrations/CreateMetadataTable.php
deleted file mode 100644
index 3cbce77..0000000
--- a/database/migrations/CreateMetadataTable.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateMetadataTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('metadata', function (Blueprint $table) {
-            $table->id();
-            $table->integer('artefact_id')->unsigned();
-            $table->foreign('artefact_id')->references('id')->on('artefacts');
-
-            $table->string('name');
-            $table->longText('noteCZ');
-            $table->longText('noteEN');
-
-            $table->integer('page');
-            $table->integer('likes');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('metadata');
-    }
-}
