1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:34:04 +00:00

Model timestamps

This commit is contained in:
Samuel Štancl 2019-09-27 22:53:38 +02:00
parent 4b5554dcac
commit 6b103cd2cb
6 changed files with 10 additions and 6 deletions

View file

@ -17,9 +17,11 @@ class CreateTenantsTable extends Migration
{
Schema::create('tenants', function (Blueprint $table) {
$table->string('id', 36)->primary(); // 36 characters is the default uuid length
// (optional) your custom, indexed columns can go here
// (optional) your custom, indexed columns may go here
$table->json('data');
$table->timestamps();
});
}

View file

@ -18,6 +18,7 @@ class CreateDomainsTable extends Migration
Schema::create('domains', function (Blueprint $table) {
$table->string('domain', 255)->primary();
$table->string('tenant_id', 36);
$table->timestamps();
$table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
});