1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:54:05 +00:00
tenancy/assets/migrations/2019_09_15_000020_create_domains_table.php
Anton Komarev ee06ff296e [2.x] Make Domain's model domain key as a primary (#141)
* Make Domain's model domain key as a primary

* Remove comments
2019-09-26 18:04:39 +02:00

35 lines
755 B
PHP

<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDomainsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('domains', function (Blueprint $table) {
$table->string('domain', 255)->primary();
$table->string('tenant_id', 36);
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('domains');
}
}