Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. [IlluminateDatabaseQueryException]
  2. SQLSTATE[HY000]: General error: 1005 Can't create table `consultorio`.`#sql-1e78_69` (errno: 150 "Foreign key const
  3. raint is incorrectly formed") (SQL: alter table `consultas` add constraint `consultas_id_doctors_foreign` foreign k
  4. ey (`id_doctors`) references `doctors` (`id`))
  5.  
  6. [PDOException]
  7. SQLSTATE[HY000]: General error: 1005 Can't create table `consultorio`.`#sql-1e78_69` (errno: 150 "Foreign key const
  8. raint is incorrectly formed")
  9.  
  10. Schema::create('consultas', function (Blueprint $table) {
  11. $table->increments('id');
  12. $table->date('fecha');
  13. $table->string('patologia');
  14.  
  15. $table->integer('id_doctors')->unsigned();
  16. $table->foreign('id_doctors')->references('id')->on('doctors');
  17.  
  18. $table->integer('id_pacientes')->unsigned();
  19. $table->foreign('id_pacientes')->references('id')->on('pacientes');
  20.  
  21. $table->timestamps();
  22.  
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement