Search
 
SCRIPT & CODE EXAMPLE
 

PHP

General error: 1215 Cannot add foreign key constraint laravel

Laravel 5.8 Added bigIncrements As Defaults

So there is mismatch in foreign key field types. You see bigIncrements(id) in 
User table and unsigned Integer(user_id) in questions table.

How to fix:

1. Either change original migration from bigIncrements() to just
increments()

2. Or in your foreign key column do unsignedBigInteger() instead of 
unsignedInteger().
Comment

PREVIOUS NEXT
Code Example
Php :: print date in php 
Php :: php to save txt html 
Php :: Find ip address location php 
Php :: php set selected option 
Php :: php remove bom 
Php :: set character set utf8 in pdo php 
Php :: convert string to decimal php 
Php :: laravel app get locale 
Php :: PHPspreadsheet getColumnDimension 
Php :: logout in laravel 8 
Php :: collection laravel filter 
Php :: laravel default websie ar 
Php :: laravel not finding asset files in public directory 
Php :: php time format 
Php :: how to get array dont similer elements in php 
Php :: bcrypt laravel 
Php :: php read xml file into array 
Php :: php pop off the first character of string 
Php :: laravel json response decode 
Php :: laravel update single field 
Php :: php validate phone number 
Php :: how to take last entry in database in laravel Method Three 
Php :: php dias entre dos fechas 
Php :: doctrine mongodb native query 
Php :: how to update all row in laravel 
Php :: php detect mobile 
Php :: how get just one parameter of all objects in one array in laravel 
Php :: php get day diff 
Php :: restcord Guild Icon outputs 404. 
Php :: php show error 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =