Use artisan for the reload-db dev command
This commit is contained in:
6
Makefile
6
Makefile
@@ -58,11 +58,7 @@ reset: cleanapp/Models/Traits/JournalTrait.php
|
||||
|
||||
.PHONY: reload-db
|
||||
reload-db:
|
||||
@php artisan database:create --reset
|
||||
@php artisan migrate:fresh --seed
|
||||
@php artisan phpvms:yaml-import app/Database/seeds/sample.yml
|
||||
@php artisan phpvms:yaml-import app/Database/seeds/acars.yml
|
||||
#php artisan phpvms:navdata
|
||||
@php artisan phpvms:dev-install --reset-db
|
||||
|
||||
.PHONY: tests
|
||||
tests: test
|
||||
|
||||
@@ -14,6 +14,14 @@ class DevInstall extends Command
|
||||
protected $signature = 'phpvms:dev-install {--reset-db}';
|
||||
protected $description = 'Run a developer install and run the sample migration';
|
||||
|
||||
/**
|
||||
* The YAML files with sample data to import
|
||||
*/
|
||||
protected $yaml_imports = [
|
||||
'sample.yml',
|
||||
'acars.yml',
|
||||
];
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
|
||||
@@ -34,9 +42,6 @@ class DevInstall extends Command
|
||||
|
||||
$this->info(\Artisan::output());
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
$this->info('Running migrations');
|
||||
\Artisan::call('migrate:fresh', [
|
||||
'--seed' => true,
|
||||
@@ -48,11 +53,13 @@ class DevInstall extends Command
|
||||
#
|
||||
|
||||
$this->info('Importing sample data');
|
||||
\Artisan::call('phpvms:yaml-import', [
|
||||
'files' => ['app/Database/seeds/sample.yml'],
|
||||
]);
|
||||
foreach($this->yaml_imports as $yml) {
|
||||
\Artisan::call('phpvms:yaml-import', [
|
||||
'files' => ['app/Database/seeds/' . $yml],
|
||||
]);
|
||||
|
||||
$this->info(\Artisan::output());
|
||||
$this->info(\Artisan::output());
|
||||
}
|
||||
|
||||
$this->info('Done!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user