Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2019_10_10_095050_create_quota_table.php
<?php | <?php | ||||
use Illuminate\Support\Facades\Schema; | use Illuminate\Support\Facades\Schema; | ||||
use Illuminate\Database\Schema\Blueprint; | use Illuminate\Database\Schema\Blueprint; | ||||
use Illuminate\Database\Migrations\Migration; | use Illuminate\Database\Migrations\Migration; | ||||
class CreateQuotaTable extends Migration | class CreateQuotaTable extends Migration | ||||
{ | { | ||||
/** | /** | ||||
* Run the migrations. | * Run the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function up() | public function up() | ||||
{ | { | ||||
/* | |||||
Schema::create('quotas', function (Blueprint $table) { | Schema::create('quotas', function (Blueprint $table) { | ||||
$table->bigIncrements('id'); | $table->bigIncrements('id'); | ||||
$table->bigInteger('user_id'); | $table->bigInteger('user_id'); | ||||
$table->integer('value')->default(2147483648); | $table->unsignedInteger('value')->default(2147483648); | ||||
$table->timestamps(); | $table->timestamps(); | ||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); | ||||
}); | }); | ||||
*/ | |||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
Schema::dropIfExists('quotas'); | Schema::dropIfExists('quotas'); | ||||
} | } | ||||
} | } |