mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
[2.x] Make Domain's model domain key as a primary (#141)
* Make Domain's model domain key as a primary * Remove comments
This commit is contained in:
parent
3f4018f93c
commit
ee06ff296e
2 changed files with 3 additions and 3 deletions
|
|
@ -16,8 +16,8 @@ class CreateDomainsTable extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('domains', function (Blueprint $table) {
|
Schema::create('domains', function (Blueprint $table) {
|
||||||
$table->string('tenant_id', 36); // 36 characters is the default uuid length
|
$table->string('domain', 255)->primary();
|
||||||
$table->string('domain', 255)->unique(); // don't change this
|
$table->string('tenant_id', 36);
|
||||||
|
|
||||||
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
|
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class DomainModel extends Model
|
||||||
use CentralConnection;
|
use CentralConnection;
|
||||||
|
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'domain';
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue