1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:54:05 +00:00

Migration paths (#268)

* allow multiple paths for tenant migrations

* tests: allow multiple paths for tenant migrations

* Update tests/CommandsTest.php

Co-Authored-By: Samuel Štancl <samuel.stancl@gmail.com>

* Update src/Traits/DealsWithMigrations.php

Co-Authored-By: Samuel Štancl <samuel.stancl@gmail.com>

* Update tests/CommandsTest.php

Co-Authored-By: Samuel Štancl <samuel.stancl@gmail.com>

* Update src/Traits/DealsWithMigrations.php

Co-Authored-By: Samuel Štancl <samuel.stancl@gmail.com>

* Update tests/TestCase.php

Co-Authored-By: Samuel Štancl <samuel.stancl@gmail.com>

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
curious-jim 2020-02-16 19:10:50 +08:00 committed by GitHub
parent 95ee295da1
commit 06ee1ff0e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -12,6 +12,6 @@ trait DealsWithMigrations
return parent::getMigrationPaths(); 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')]);
} }
} }

View file

@ -18,7 +18,7 @@ class CommandsTest extends TestCase
{ {
parent::setUp(); parent::setUp();
config(['tenancy.migrations_directory' => database_path('../migrations')]); config(['tenancy.migration_paths', [database_path('../migrations')]]);
} }
/** @test */ /** @test */

View file

@ -96,7 +96,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'tenancy.redis.tenancy' => env('TENANCY_TEST_REDIS_TENANCY', true), 'tenancy.redis.tenancy' => env('TENANCY_TEST_REDIS_TENANCY', true),
'database.redis.client' => env('TENANCY_TEST_REDIS_CLIENT', 'phpredis'), 'database.redis.client' => env('TENANCY_TEST_REDIS_CLIENT', 'phpredis'),
'tenancy.redis.prefixed_connections' => ['default'], 'tenancy.redis.prefixed_connections' => ['default'],
'tenancy.migrations_directory' => database_path('../migrations'), 'tenancy.migration_paths' => [database_path('../migrations')],
'tenancy.storage_drivers.db.connection' => 'central', 'tenancy.storage_drivers.db.connection' => 'central',
'tenancy.bootstrappers.redis' => \Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper::class, 'tenancy.bootstrappers.redis' => \Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper::class,
'queue.connections.central' => [ 'queue.connections.central' => [