2025-06-28 02:35:58 +02:00
|
|
|
#!/usr/bin/env php
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
2025-06-28 11:36:16 +02:00
|
|
|
|
|
|
|
|
// Ensure database file exists
|
|
|
|
|
$dbPath = __DIR__ . '/../storage/database.sqlite';
|
|
|
|
|
if (!file_exists($dbPath)) {
|
|
|
|
|
touch($dbPath);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-28 02:35:58 +02:00
|
|
|
require __DIR__ . '/../bootstrap/database.php';
|
|
|
|
|
|
|
|
|
|
use Illuminate\Filesystem\Filesystem;
|
|
|
|
|
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
|
|
|
|
|
use Illuminate\Database\Migrations\Migrator;
|
|
|
|
|
|
|
|
|
|
$repository = new DatabaseMigrationRepository($capsule->getDatabaseManager(), 'migrations');
|
|
|
|
|
$migrator = new Migrator($repository, $capsule->getDatabaseManager(), new Filesystem);
|
|
|
|
|
|
|
|
|
|
if (! $repository->repositoryExists()) {
|
|
|
|
|
$repository->createRepository();
|
|
|
|
|
echo "Migration table created.\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$migrator->run(__DIR__ . '/../database/migrations');
|
|
|
|
|
echo "Migrations complete.\n";
|