From 06ee1ff0e28f131bf8a4e064cdd3e8a1c1b11293 Mon Sep 17 00:00:00 2001 From: curious-jim Date: Sun, 16 Feb 2020 19:10:50 +0800 Subject: [PATCH] Migration paths (#268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * allow multiple paths for tenant migrations * tests: allow multiple paths for tenant migrations * Update tests/CommandsTest.php Co-Authored-By: Samuel Štancl * Update src/Traits/DealsWithMigrations.php Co-Authored-By: Samuel Štancl * Update tests/CommandsTest.php Co-Authored-By: Samuel Štancl * Update src/Traits/DealsWithMigrations.php Co-Authored-By: Samuel Štancl * Update tests/TestCase.php Co-Authored-By: Samuel Štancl Co-authored-by: Samuel Štancl --- src/Traits/DealsWithMigrations.php | 2 +- tests/CommandsTest.php | 2 +- tests/TestCase.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Traits/DealsWithMigrations.php b/src/Traits/DealsWithMigrations.php index a51bfa57..f730cf07 100644 --- a/src/Traits/DealsWithMigrations.php +++ b/src/Traits/DealsWithMigrations.php @@ -12,6 +12,6 @@ trait DealsWithMigrations return parent::getMigrationPaths(); } - return [config('tenancy.migrations_directory', database_path('migrations/tenant'))]; + return config('tenancy.migration_paths', [config('tenancy.migrations_directory') ?? database_path('migrations/tenant')]); } } diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index 071f929c..6bcf6fd9 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -18,7 +18,7 @@ class CommandsTest extends TestCase { parent::setUp(); - config(['tenancy.migrations_directory' => database_path('../migrations')]); + config(['tenancy.migration_paths', [database_path('../migrations')]]); } /** @test */ diff --git a/tests/TestCase.php b/tests/TestCase.php index 8df82561..336bff07 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -96,7 +96,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase 'tenancy.redis.tenancy' => env('TENANCY_TEST_REDIS_TENANCY', true), 'database.redis.client' => env('TENANCY_TEST_REDIS_CLIENT', 'phpredis'), 'tenancy.redis.prefixed_connections' => ['default'], - 'tenancy.migrations_directory' => database_path('../migrations'), + 'tenancy.migration_paths' => [database_path('../migrations')], 'tenancy.storage_drivers.db.connection' => 'central', 'tenancy.bootstrappers.redis' => \Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper::class, 'queue.connections.central' => [