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

Add support for postgres schema (#237)

* Add support for postgres schema

* wip

* Apply fixes from StyleCI

* revert to db as default for pgsql

* Move separate_by to database

* Fixing testing

* Fixing style

* Reverted change

* Store string instead of Connection instance

* Remove use statement

* Add use statement for DB facade

* mysql -> pgsql

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
Noor Adiana 2020-03-11 02:15:07 +07:00 committed by GitHub
parent e02bd3927a
commit d0023c482a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 221 additions and 2 deletions

View file

@ -24,11 +24,12 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
Redis::connection('tenancy')->flushdb();
Redis::connection('cache')->flushdb();
$originalConnection = config('database.default');
$this->loadMigrationsFrom([
'--path' => realpath(__DIR__ . '/../assets/migrations'),
'--database' => 'central',
]);
config(['database.default' => 'sqlite']); // fix issue caused by loadMigrationsFrom
config(['database.default' => $originalConnection]); // fix issue caused by loadMigrationsFrom
if ($this->autoCreateTenant) {
$this->createTenant();