Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

olavidps's avatar

General error 1025

Hello, I'm developing a project in laravel 5.1, at the beginning I created my migrations using 'laravelsd', because my project involves some additional features for the users table, I've modified the User migration that creates the user table and comes with laravel, then were added other 'initial' migrations. All the initial migrations worked fine, (at least the first 'php artisan migrate' to create all the tables), but when I create another migration it seems to work fine and if I do a 'rollback' it also works fine, but if I make other 'rollback' again, it fails.

My objective is that in some point when I'm developing, if I would to modify the 'first migrations' that create the tables, make a 'rollback' and back to the beginning(database empty), alter the 'first migrations' then 'php artisan migrate'.

Recap:
  1. I've modified the original migrations, then I executed 'php artisan migrate' (works fine)
  2. I've added a specific migration, then executed 'php artisan migrate' (works fine)
  3. If I do 'php artisan:rollback' (It backs one step, fine)
  4. If I do another 'php artisan: rollback', with the objective of get my database empty, modify the initial migrations files that create the tables,waiting to be able to create the initial tables modified on another 'php artisan migrate'. (but it fails)
MacBook-Pro-de-Oscar:project olavid$ php artisan migrate
Migrated: 2017_03_22_025456_create_classroom_column_on_course_table
MacBook-Pro-de-Oscar:project olavid$ php artisan migrate:rollback
Rolled back: 2017_03_22_025456_create_classroom_column_on_course_table
MacBook-Pro-de-Oscar:project olavid$ php artisan migrate:rollback

[Illuminate\Database\QueryException]                                         
  SQLSTATE[HY000]: General error: 1025 Error on rename of './school/school' t  
  o './school/#sql2-2e2-a' (errno: 152) (SQL: alter table `school` drop forei  
  gn key `school_actualPeriod_foreign`)                                        
                                                                             
                                                                             
  [PDOException]                                                               
  SQLSTATE[HY000]: General error: 1025 Error on rename of './school/school' t  
  o './school/#sql2-2e2-a' (errno: 152)

0 likes
0 replies

Please or to participate in this conversation.