Skip to content

Commit

Permalink
Update to Big Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Keith committed Feb 27, 2019
1 parent 77081e9 commit 674e760
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions migrations/create_tenants_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ class CreateTenantsTable extends Migration
$tableNames = config('multitenancy.table_names');

Schema::create($tableNames['tenants'], function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('domain')->unique();
$table->timestamps();
});

Schema::create($tableNames['tenant_user'], function (Blueprint $table) use ($tableNames) {
$table->increments('id');
$table->bigIncrements('id');

$table->unsignedInteger('tenant_id');
$table->unsignedBigInteger('tenant_id');
$table->foreign('tenant_id')
->references('id')
->on($tableNames['tenants'])
->onDelete('cascade');

$table->unsignedInteger('user_id');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')
->references('id')
->on($tableNames['users'])
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/stubs/add_tenancy_to_table.stub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DummyClass extends Migration
public function up()
{
Schema::table("DummyTable", function (Blueprint $table) {
$table->unsignedInteger('tenant_id')->nullable();
$table->unsignedBigInteger('tenant_id')->nullable();
$table->foreign('tenant_id')
->references('id')
->on("DummyTenantTable")
Expand Down

0 comments on commit 674e760

Please sign in to comment.