mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 12:04:03 +00:00
Try conditionally creating tenants table
This commit is contained in:
parent
d14eb8609b
commit
b66773da80
1 changed files with 12 additions and 0 deletions
|
|
@ -55,9 +55,21 @@ test('correct rls policies get created', function(bool $action) {
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Schema::dropIfExists('tenants');
|
||||||
Schema::dropIfExists('comments');
|
Schema::dropIfExists('comments');
|
||||||
Schema::dropIfExists('posts');
|
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) {
|
Schema::create('posts', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('text');
|
$table->string('text');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue