cannot add foreign key constraint laravel
Add it in two steps, and its good to make it unsigned too:
public function up()
{
Schema::create('priorities', function($table) {
$table->increments('id', true);
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->string('priority_name');
$table->smallInteger('rank');
$table->text('class');
$table->timestamps('timecreated');
});
}
if still same error try removing unsigned() from the above code
Also in PHP:
- apt-get install php 7.4
- acf auto increment field
- c date format php
- array_column in php
- errno: 150 foreign key constraint is incorrectly formed laravel 8
- capital letter php
- array_add laravel 7
- date time format year php
- F d php
- console.log php variables $this
- clear laravel cache telescope
- :user="{{auth()->user()}}
- check key array php
- <?phpheader("Location:
- enable php errors
- check if string contains substring php
- convert string to uppercase in php
- date("l") php
- Undefined offset: 0 at laravel\framework\src\Illuminate\Routing\Router.php
- date between query in codeigniter
- date convert string timestamp to date php
- check if date is within range php
- convert date and time to timestamp php
- artisan migrate table