mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-03 23:09:18 +02:00
39 lines
744 B
PHP
39 lines
744 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Install\Commands;
|
|
|
|
use CodeIgniter\CLI\BaseCommand;
|
|
use Config\Database;
|
|
use Config\Services;
|
|
|
|
class InitDatabase extends BaseCommand
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $group = 'Install';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $name = 'install:init-database';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $description = 'Runs all database migrations for Castopod.';
|
|
|
|
public function run(array $params): void
|
|
{
|
|
// Run all migrations
|
|
$migrate = Services::migrations();
|
|
$migrate->setNamespace(null)
|
|
->latest();
|
|
|
|
// Seed database
|
|
$seeder = Database::seeder();
|
|
$seeder->call('AppSeeder');
|
|
}
|
|
}
|