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

Tenant-specific connections, some work to get tests running

This commit is contained in:
Samuel Štancl 2019-09-15 17:44:26 +02:00
parent e25a01a997
commit c65b6839ff
13 changed files with 162 additions and 67 deletions

View file

@ -3,9 +3,9 @@
declare(strict_types=1);
return [
'storage_driver' => 'Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver',
'storage_driver' => 'Stancl\Tenancy\StorageDrivers\Database\DatabaseStorageDriver',
'storage' => [
'db' => [ // Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver
'db' => [ // Stancl\Tenancy\StorageDrivers\Database\DatabaseStorageDriver
'data_column' => 'data',
'custom_columns' => [
// 'plan',
@ -60,6 +60,7 @@ return [
'cache' => 'Stancl\Tenancy\TenancyBootstrappers\CacheTenancyBootstrapper',
'filesystem' => 'Stancl\Tenancy\TenancyBootstrappers\FilesystemTenancyBootstrapper',
'redis' => 'Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper',
'queue' => 'Stancl\Tenancy\TenancyBoostrappers\QueueTenancyBootstrapper',
],
'features' => [
// Features are classes that provide additional functionality

View file

@ -16,10 +16,8 @@ class CreateTenantsTable extends Migration
public function up()
{
Schema::create('tenants', function (Blueprint $table) {
$table->string('uuid', 36)->primary(); // don't change this
$table->string('domain', 255)->index(); // don't change this
// your indexed columns go here
$table->string('id', 36)->primary(); // 36 characters is the default uuid length
// your custom, indexed columns go here
$table->json('data');
});

View file

@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDomainsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('domains', function (Blueprint $table) {
$table->string('tenant_id', 36)->primary(); // 36 characters is the default uuid length
$table->string('domain', 255)->index(); // don't change this
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('domains');
}
}