1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 08:44:04 +00:00

Try conditionally creating tenants table

This commit is contained in:
lukinovec 2023-04-27 13:08:24 +02:00
parent d14eb8609b
commit b66773da80

View file

@ -55,9 +55,21 @@ test('correct rls policies get created', function(bool $action) {
],
]);
// Schema::dropIfExists('tenants');
Schema::dropIfExists('comments');
Schema::dropIfExists('posts');
if(! Schema::hasTable('tenants')) {
Schema::create('tenants', function (Blueprint $table) {
$table->string('id')->primary();
// your custom columns may go here
$table->timestamps();
$table->json('data')->nullable();
});
}
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->string('text');