Update README.md, remove migration.php, add message to browser.php

This commit is contained in:
Krzysztof Płaczek
2024-10-12 12:48:15 +02:00
parent 39e0262036
commit 2842ad1b2e
4 changed files with 11 additions and 52 deletions

View File

@@ -6,6 +6,10 @@ use Illuminate\Database\Capsule\Manager as Capsule;
use Krzysiej\RyobiCrawler\Models\Product;
use Twig\{Environment, Loader\FilesystemLoader};
if (!file_exists('database.sqlite')) {
exit('Database file <code>database.sqlite</code> missing. Run docker compose <blockquote>docker compose exec php-app php index.php app:migrate</blockquote> to create it.');
}
$capsule = new Capsule;
$capsule->addConnection(['driver' => 'sqlite', 'database' => __DIR__ . '/database.sqlite']);
$capsule->setAsGlobal();