bigIncrements('id'); $table->bigInteger('lead_id')->nullable(); $table->bigInteger('template_id')->nullable(); $table->tinyInteger('in_pdf')->nullable()->default(0); $table->date('begin')->nullable(); $table->date('end')->nullable(); $table->bigInteger('type_id')->nullable(); $table->string('type_s', 80)->nullable(); $table->text('data_s')->nullable(); $table->bigInteger('view_position')->nullable(); $table->index('lead_id', 'inquiry_lead_id_idx'); $table->index('template_id', 'inquiry_template_id_idx'); $table->index('type_id', 'inquiry_type_id_idx'); $table->foreign('lead_id', 'inquiry_lead_id_lead_id')->references('id')->on('lead')->onDelete('CASCADE ')->onUpdate('RESTRICT'); $table->foreign('template_id', 'inquiry_template_id_inquiry_template_id')->references('id')->on('inquiry_template')->onDelete('CASCADE ')->onUpdate('RESTRICT'); $table->foreign('type_id', 'inquiry_type_id_inquiry_type_id')->references('id')->on('inquiry_type')->onDelete('RESTRICT ')->onUpdate('RESTRICT'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('inquiry'); } }