1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 17:04:03 +00:00
This commit is contained in:
Samuel Štancl 2019-08-10 10:20:53 +02:00
parent 401212bd6c
commit 03f233b975
3 changed files with 7 additions and 3 deletions

View file

@ -12,6 +12,7 @@ class Tenant extends Model implements TenantModel
protected $guarded = [];
protected $primaryKey = 'uuid';
public $incrementing = false;
public $timestamps = false;
/**
* Decoded data from the data column.

View file

@ -16,7 +16,7 @@ class CreateTenantsTable extends Migration
Schema::create('tenants', function (Blueprint $table) {
$table->string('uuid', 36)->primary();
$table->string('domain', 255)->index();
$table->string('data', 1024);
$table->string('data', 1024)->default('{}');
});
}

View file

@ -22,7 +22,10 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
Redis::connection('tenancy')->flushdb();
Redis::connection('cache')->flushdb();
Artisan::call('migrate'); // todo load default migration
Artisan::call('migrate:fresh');
$this->loadLaravelMigrations();
$this->loadMigrationsFrom(__DIR__ . '/../src/assets/migrations');
if ($this->autoCreateTenant) {
$this->createTenant();
@ -95,7 +98,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'tenancy.storage_driver' => DatabaseStorageDriver::class,
]);
tenancy()->setStorageDriver(DatabaseStorageDriver::class);
break;
case '2':
$app['config']->set([