Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

SQLSTATE[HY000]: General error: 1005 Can't create table `laravel`.`users` (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table `users` add constraint `users_role_id_foreign` foreign key (`role_id`) references `role` (`id`))

Mohamed Sahfas answered on November 15, 2021 Popularity 9/10 Helpfulness 4/10

Contents


More Related Answers

  • SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = ipris and table_name = migrations and table_type = 'BASE TABLE')
  • Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table (SQL: alter table `groups` add constraint `groups_user_id_foreign` foreign key (`user_id`) references `users` (`id`))
  • General error: 1215 Cannot add foreign key constraint laravel
  • SQLSTATE[HY000]: General error: 3780 Referencing column 'role_id' and referenced column 'id' in foreign key constraint 'user_role_id foreign' are incompatible.
  • errno: 150 foreign key constraint is incorrectly formed laravel 8
  • Illuminate\Database\QueryException SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = example-app and table_name = migrations and table_type = 'BASE TABLE')
  • SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
  • General error: 1005 Can't create table `installers_portal`.`media` (errno: 150 "Foreign key constraint is incorrectly formed")")
  • php artisan migrate SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'password_resets' already exists
  • laravel SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = testDB and table_name = migrations and table_type = 'BASE TABLE')
  • Illuminate\Database\QueryException SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = example-app and table_name = migrations and table_type = 'BASE TABLE')
  • Illuminate\Database\QueryException SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
  • SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = blog_inertia and table_name = migrations and table_type = 'BASE TABLE')
  • sqlstate[hy000]: general error: 1005 can't create table (errno: 150 "foreign key constraint is incorrectly formed")
  • Laravel: Foreign id does not have default value
  • Syntax error or access violation: 1072 Key column doesnt exist in table laravel migrate
  • SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'expense_category_id' doesn't exist in table (SQL: alter table `expenses` add constraint `expenses_expense_category_id_fore ign` foreign key (`expense_category_id`) references `expense_cat

  • SQLSTATE[HY000]: General error: 1005 Can't create table `laravel`.`users` (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table `users` add constraint `users_role_id_foreign` foreign key (`role_id`) references `role` (`id`))

    0
    Popularity 9/10 Helpfulness 4/10 Language whatever
    Link to this answer
    Share Copy Link
    Contributed on Aug 25 2022
    Mohamed Sahfas
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    0
    Popularity 9/10 Helpfulness 1/10 Language php
    Tags: add
    Link to this answer
    Share Copy Link
    Contributed on Nov 15 2021
    Excited Elephant
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.