BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.22k stars 1.9k forks source link

Updating from 30.01 to last version #2532

Closed EloFran closed 3 years ago

EloFran commented 3 years ago

Describe the bug Syntax error or access violation: 1091 Can't DROP COLUMN id

Steps To Reproduce Steps to reproduce the behavior:

  1. git pull origin release && composer install --no-dev && php artisan migrate
  2. Updated
  3. Loading composer repositories with package information Installing dependencies from lock file
  4. 
    Migrating: 2020_08_04_111754_drop_joint_permissions_id
    
    Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP COLUMN `id`; check that it exists (SQL: alter table `joint_permissions` drop `id`)
    
    at /home/fiianiwg/libros.estudiaconelo.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
    > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|
    
    Exception trace:
    
    1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP COLUMN `id`; check that itexists")
      /home/fiianiwg/libros.estudiaconelo.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:131
    
    2   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP COLUMN `id`; check that it exists")
      /home/fiianiwg/libros.estudiaconelo.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:129
    
    Please use the argument -v to see more details. 

**Expected behavior**
Update BookStack at last version

**Screenshots**
![image](https://user-images.githubusercontent.com/37640520/106732236-bfe68e80-6610-11eb-996a-2ba80da20d0b.png)

**Your Configuration (please complete the following information):**
 - Exact BookStack Version (Found in settings): v0.30.3
 - PHP Version: 7.4
 - Hosting Method (Nginx/Apache/Docker): Apache

**Additional context**
Add any other context about the problem here.
ssddanbrown commented 3 years ago

Hi @EloFran, Sorry to hear you're having trouble. This is likely due to a database migration issue during your previous upgrade.

This should be repairable by running the MySQL commands in my first comment in this thread: https://github.com/BookStackApp/BookStack/issues/2317#issuecomment-707371525 Then re-run the update steps.

Just let me know if you need any further guidance on this.

EloFran commented 3 years ago

Very thx, I followed the steps to rebuild the columns of the db, and for now everything is correct.

ssddanbrown commented 3 years ago

Good news! will therefore close this off.