mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Removed Firefly’s ability to generate test data.
This commit is contained in:
@@ -28,7 +28,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(TransactionCurrencySeeder::class);
|
||||
$this->call(TransactionTypeSeeder::class);
|
||||
$this->call(PermissionSeeder::class);
|
||||
$this->call(TestDataSeeder::class);
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* TestDataSeeder.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
use FireflyIII\Support\Migration\TestData;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
/**
|
||||
* Class TestDataSeeder
|
||||
*/
|
||||
class TestDataSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* TestDataSeeder constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$disk = Storage::disk('seeds');
|
||||
$env = App::environment();
|
||||
Log::debug('Environment is ' . $env);
|
||||
$fileName = 'seed.' . $env . '.json';
|
||||
if ($disk->exists($fileName)) {
|
||||
Log::debug('Now seeding ' . $fileName);
|
||||
$file = json_decode($disk->get($fileName), true);
|
||||
|
||||
if (is_array($file)) {
|
||||
// run the file:
|
||||
TestData::run($file);
|
||||
|
||||
return;
|
||||
}
|
||||
Log::error(sprintf('No valid data found (%s) for environment %s', $fileName, $env));
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
Log::error(sprintf('No seed file (%s) for environment %s', $fileName, $env));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user