1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14: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

@ -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');
}
}