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

Add SessionTenancyBootstrapper (#2)

* Add SessionTenancyBootstrapper

* Fix code style (php-cs-fixer)

* add value to bootstrappers config

* tenant aware call test

* reproduce issue in tests

* fix logic for calling tenant run from central context, finish tests

* change laravel version back

* bump laravel to ^9.38

* add listener to create tenant DBs

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
This commit is contained in:
Samuel Štancl 2022-11-20 02:32:25 +01:00 committed by GitHub
parent ff46bcfe20
commit 5849089373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 251 additions and 3 deletions

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSessionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sessions');
}
}