Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2019_09_17_102628_create_sku_entitlements.php
Show All 28 Lines | public function up() | ||||
$table->timestamps(); | $table->timestamps(); | ||||
} | } | ||||
); | ); | ||||
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('entitleable_id'); | $table->bigInteger('entitleable_id'); | ||||
$table->string('entitleable_type'); | $table->string('entitleable_type'); | ||||
$table->integer('cost')->default(0)->nullable(); | $table->integer('cost')->default(0)->nullable(); | ||||
$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('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | $table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
Show All 9 Lines |