mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:54:03 +00:00
wip
This commit is contained in:
parent
401212bd6c
commit
03f233b975
3 changed files with 7 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ class Tenant extends Model implements TenantModel
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
protected $primaryKey = 'uuid';
|
protected $primaryKey = 'uuid';
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decoded data from the data column.
|
* Decoded data from the data column.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class CreateTenantsTable extends Migration
|
||||||
Schema::create('tenants', function (Blueprint $table) {
|
Schema::create('tenants', function (Blueprint $table) {
|
||||||
$table->string('uuid', 36)->primary();
|
$table->string('uuid', 36)->primary();
|
||||||
$table->string('domain', 255)->index();
|
$table->string('domain', 255)->index();
|
||||||
$table->string('data', 1024);
|
$table->string('data', 1024)->default('{}');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22,7 +22,10 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
|
|
||||||
Redis::connection('tenancy')->flushdb();
|
Redis::connection('tenancy')->flushdb();
|
||||||
Redis::connection('cache')->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) {
|
if ($this->autoCreateTenant) {
|
||||||
$this->createTenant();
|
$this->createTenant();
|
||||||
|
|
@ -95,7 +98,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
'tenancy.storage_driver' => DatabaseStorageDriver::class,
|
'tenancy.storage_driver' => DatabaseStorageDriver::class,
|
||||||
]);
|
]);
|
||||||
tenancy()->setStorageDriver(DatabaseStorageDriver::class);
|
tenancy()->setStorageDriver(DatabaseStorageDriver::class);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
$app['config']->set([
|
$app['config']->set([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue