bigIncrements('id'); $table->string('number', 30)->nullable(); $table->bigInteger('customer_id'); $table->bigInteger('booking_id'); $table->decimal('value', 10, 2)->default(0.00); $table->date('issue_date'); $table->date('valid_date'); $table->tinyInteger('is_redeemed')->default(0); $table->date('redeem_date')->nullable(); $table->text('text')->nullable(); $table->dateTime('created_at'); $table->dateTime('updated_at'); $table->index('customer_id', 'customer_id_idx'); $table->index('booking_id', 'booking_id_idx'); $table->foreign('booking_id', 'coupon_booking_id_booking_id')->references('id')->on('booking')->onDelete('RESTRICT ')->onUpdate('RESTRICT'); $table->foreign('customer_id', 'coupon_customer_id_customer_id')->references('id')->on('customer')->onDelete('RESTRICT ')->onUpdate('RESTRICT'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('coupon'); } }