Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateCartsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('carts', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->unsignedBigInteger('user_id')->nullable();
- $table->string('session_id')->nullable();
- $table->string('user_agent');
- $table->softDeletes();
- $table->timestamps();
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('carts');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement