diff --git a/src/Tenant.php b/src/Tenant.php index b7926841..c91341e6 100644 --- a/src/Tenant.php +++ b/src/Tenant.php @@ -12,6 +12,7 @@ class Tenant extends Model implements TenantModel protected $guarded = []; protected $primaryKey = 'uuid'; public $incrementing = false; + public $timestamps = false; /** * Decoded data from the data column. diff --git a/src/assets/2019_08_08_000000_create_tenants_table.php b/src/assets/migrations/2019_08_08_000000_create_tenants_table.php similarity index 91% rename from src/assets/2019_08_08_000000_create_tenants_table.php rename to src/assets/migrations/2019_08_08_000000_create_tenants_table.php index 76c0a59d..eafc175a 100644 --- a/src/assets/2019_08_08_000000_create_tenants_table.php +++ b/src/assets/migrations/2019_08_08_000000_create_tenants_table.php @@ -16,7 +16,7 @@ class CreateTenantsTable extends Migration Schema::create('tenants', function (Blueprint $table) { $table->string('uuid', 36)->primary(); $table->string('domain', 255)->index(); - $table->string('data', 1024); + $table->string('data', 1024)->default('{}'); }); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 39554f0f..02f69c66 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -22,7 +22,10 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase Redis::connection('tenancy')->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) { $this->createTenant(); @@ -95,7 +98,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase 'tenancy.storage_driver' => DatabaseStorageDriver::class, ]); tenancy()->setStorageDriver(DatabaseStorageDriver::class); - + break; case '2': $app['config']->set([