Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update (from git / master): Syntax error or access violation: 1072 Key column 'subsection' doesn't exist in table #1639

Closed
count00zero opened this issue Nov 4, 2024 · 13 comments

Comments

@count00zero
Copy link

count00zero commented Nov 4, 2024

Hi, help is appreciated, thanks in advance!!!

024_10_28_092803_drop_columns_from_settings_table ................................................................................... 3.48ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'subsection' doesn't exist in table (Connection: mariadb, SQL: alter table `settings` drop `section`, drop `subsection`, drop `hint`, drop `setting`)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821\u2595                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822\u2595                 );
    823\u2595             }
    824\u2595 
  \u279c 825\u2595             throw new QueryException(
    826\u2595                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827\u2595             );
    828\u2595         }
    829\u2595     }

      +9 vendor frames 

  10  database/migrations/2024_10_28_092803_drop_columns_from_settings_table.php:14
      Illuminate\Support\Facades\Facade::__callStatic()
      +23 vendor frames 

  34  app/Console/Commands/UpdateNNTmuxDB.php:36
      Illuminate\Console\Command::call()
@nakedgoat
Copy link

I was getting those and I had to checkout 3.0.1

@count00zero
Copy link
Author

Thank you @nakedgoat, I will try that!

@DariusIII
Copy link
Member

This issue should have been fixed couple of days ago, as i pushed couple of changes related to this migration.

@count00zero
Copy link
Author

count00zero commented Nov 7, 2024

I checked out master again (no luck):
Updating database

   INFO  Running migrations.  

  2024_10_28_092803_drop_columns_from_settings_table ................................................................................... 4.04ms FAIL

   Illuminate\Database\QueryException 

  SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'subsection' doesn't exist in table (Connection: mariadb, SQL: alter table `settings` drop `section`, drop `subsection`, drop `hint`, drop `setting`)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821\u2595                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822\u2595                 );
    823\u2595             }
    824\u2595 
  \u279c 825\u2595             throw new QueryException(
    826\u2595                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827\u2595             );
    828\u2595         }
    829\u2595     }

      +9 vendor frames 

  10  database/migrations/2024_10_28_092803_drop_columns_from_settings_table.php:14
      Illuminate\Support\Facades\Facade::__callStatic()
      +23 vendor frames 

  34  app/Console/Commands/UpdateNNTmuxDB.php:36
      Illuminate\Console\Command::call()

@DariusIII
Copy link
Member

Check if your settings table has these columns at all.

@count00zero
Copy link
Author

yes it has, that's why I don't understand the error :-)
grafik

@DariusIII
Copy link
Member

Drop them manually and then add the name of the migration into migration table so it is not run anymore. I cannot find why is the database doing this.

@DariusIII
Copy link
Member

Check indexes in settings table, do you have a primary that has section, subsection in them?

@count00zero
Copy link
Author

yeah those are here as well:
grafik

@DariusIII
Copy link
Member

Drop them both and then try the migration.

@DariusIII
Copy link
Member

DariusIII commented Nov 7, 2024

I have pushed an update for that migration. Maybe try it before deleting the indexes by hand.

@count00zero
Copy link
Author

Thank you very much, that did "the trick"

@DariusIII
Copy link
Member

Which one? Deleting the indexes by hand or new migration change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants