Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2019_09_17_102628_create_sku_entitlements.php
Show All 29 Lines | public function up() | ||||
); | ); | ||||
Schema::create( | Schema::create( | ||||
'entitlements', | 'entitlements', | ||||
function (Blueprint $table) { | function (Blueprint $table) { | ||||
$table->string('id', 36)->primary(); | $table->string('id', 36)->primary(); | ||||
$table->bigInteger('owner_id'); | $table->bigInteger('owner_id'); | ||||
$table->bigInteger('entitleable_id'); | $table->bigInteger('entitleable_id'); | ||||
//$table->bigInteger('entitleable_id')->nullable(); | |||||
$table->string('entitleable_type'); | $table->string('entitleable_type'); | ||||
//$table->string('entitleable_type')->nullable(); | |||||
machniak: Why these are commented? They should be nullable. | |||||
Done Inline ActionsThey weren't before, and they are not now. The entitleable_id and entitleable_type are effectively the object of the entitlement, not the subject. It basically implies every SKU entitlement applies to either a \App\Domain or a \App\User. vanmeeuwen: They weren't before, and they are not now.
The entitleable_id and entitleable_type are… | |||||
$table->string('wallet_id', 36); | $table->string('wallet_id', 36); | ||||
$table->string('sku_id', 36); | $table->string('sku_id', 36); | ||||
$table->string('description')->nullable(); | $table->string('description')->nullable(); | ||||
$table->timestamps(); | $table->timestamps(); | ||||
$table->foreign('sku_id')->references('id')->on('skus')->onDelete('cascade'); | $table->foreign('sku_id')->references('id')->on('skus')->onDelete('cascade'); | ||||
$table->foreign('owner_id')->references('id')->on('users')->onDelete('cascade'); | $table->foreign('owner_id')->references('id')->on('users')->onDelete('cascade'); | ||||
$table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | $table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | ||||
Show All 16 Lines |
Why these are commented? They should be nullable.