mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 19:34:04 +00:00
finally fixed the migrations issue
This commit is contained in:
parent
170392f15f
commit
f7ca2937fd
5 changed files with 32 additions and 16 deletions
|
|
@ -11,7 +11,7 @@ class RedisStorageDriver implements StorageDriver
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$this->redis = Redis::connection('tenancy');
|
||||
$this->redis = Redis::connection(config('tenancy.redis.connection', 'tenancy'));
|
||||
}
|
||||
|
||||
public function identifyTenant(string $domain): array
|
||||
|
|
|
|||
|
|
@ -20,12 +20,17 @@ class Tenant extends Model
|
|||
|
||||
public function dataColumn()
|
||||
{
|
||||
return config('tenancy.db_storage.data_column', 'data');
|
||||
return config('tenancy.storage.db.data_column', 'data');
|
||||
}
|
||||
|
||||
public function customColumns()
|
||||
{
|
||||
return config('tenancy.db_storage.custom_columns', []);
|
||||
return config('tenancy.storage.db.custom_columns', []);
|
||||
}
|
||||
|
||||
public function getConnectionName()
|
||||
{
|
||||
return config('tenancy.storage.db.connection');
|
||||
}
|
||||
|
||||
public function getFromData(string $key)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,17 @@
|
|||
|
||||
return [
|
||||
'storage_driver' => 'Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver',
|
||||
'db_storage' => [
|
||||
'data_column' => 'data',
|
||||
'custom_columns' => [],
|
||||
'storage' => [
|
||||
'db' => [
|
||||
'data_column' => 'data',
|
||||
'custom_columns' => [
|
||||
// 'plan',
|
||||
],
|
||||
'connection' => 'central',
|
||||
],
|
||||
'redis' => [
|
||||
'connection' => 'tenancy',
|
||||
],
|
||||
],
|
||||
'tenant_route_namespace' => 'App\Http\Controllers',
|
||||
'exempt_domains' => [
|
||||
|
|
|
|||
|
|
@ -14,8 +14,11 @@ class CreateTenantsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('tenants', function (Blueprint $table) {
|
||||
$table->string('uuid', 36)->primary();
|
||||
$table->string('domain', 255)->index();
|
||||
$table->string('uuid', 36)->primary(); // don't change this
|
||||
$table->string('domain', 255)->index(); // don't change this
|
||||
|
||||
// your indexed columns go here
|
||||
|
||||
$table->json('data')->default('{}');
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue