increments('id'); $table->string('msgId'); $table->text('msg'); $table->string('smsLength'); $table->string('receiver')->nullable(); $table->string('smsCost')->nullable(); $table->dateTime('senttime')->nullable(); $table->string('smstype')->nullable(); $table->string('status')->nullable(); $table->text('notes')->nullable(); $table->boolean('isDone')->default(false); $table->nullableMorphs('owned_by'); $table->integer('account_id')->unsigned()->nullable(); $table->integer('contact_id')->unsigned()->nullable(); $table->integer('lead_id')->unsigned()->nullable(); $table->integer('company_id')->nullable(); $table->integer('campaign_id')->unsigned()->nullable(); $table->foreign('campaign_id')->references('id')->on('campaigns'); $table->integer('sms_sender_id')->unsigned()->nullable(); $table->foreign('sms_sender_id')->references('id')->on('sms_dict_sender'); $table->foreign('account_id')->references('id')->on('accounts'); $table->foreign('contact_id')->references('id')->on('contacts'); $table->foreign('lead_id')->references('id')->on('leads'); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }