Skip to content

Commit

Permalink
Migration paths (#268)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
curious-jim and stancl authored Feb 16, 2020
1 parent 95ee295 commit 06ee1ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Traits/DealsWithMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ protected function 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')]);
}
}
2 changes: 1 addition & 1 deletion tests/CommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function setUp(): void
{
parent::setUp();

config(['tenancy.migrations_directory' => database_path('../migrations')]);
config(['tenancy.migration_paths', [database_path('../migrations')]]);
}

/** @test */
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function getEnvironmentSetUp($app)
'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' => [
Expand Down

0 comments on commit 06ee1ff

Please sign in to comment.