Hello,
I read many docs before submiting this post. when I trying to run migration file plugin:refresh I recieving error which not allow me to create foreign keys.
there are no problem on my syntax and etc...
$this->down();
Schema::create('me_texts_full_plots' , function ($table)
{
$table->increments('id');
$table->integer('title_id')->unsigned();
$table->text('content');
$table->boolean('is_published')->default(false);
$table->tinyInteger('status')->unsigned();
});
Schema::create('me_texts_short_plots' , function ($table)
{
$table->increments('id');
$table->integer('title_id')->unsigned();
$table->text('content');
$table->boolean('is_published')->default(false);
$table->tinyInteger('status')->unsigned();
});
Schema::create('me_titles' , function ($table)
{
$table->increments('id');
$table->integer('short_plot_id')->length(10)->unsigned();
$table->integer('full_plot_id')->length(10)->unsigned();
$table->boolean('is_published')->default(false)->index();
$table->tinyInteger('status')->unsigned()->nullable();
$table->softDeletes();
});
Schema::table('me_titles', function ($table)
{
$table->foreign('short_plot_id')->refrences('id')->on('me_texts_short_plots')->onDelete('cascade');
$table->foreign('full_plot_id')->refrences('id')->on('me_texts_full_plots')->onDelete('cascade');
});
any one know what can i do?
Last updated