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

Database migration fails with v5.7.3 "Expression could not be converted to string" #8745

Closed
nebulade opened this issue Aug 22, 2023 · 2 comments

Comments

@nebulade
Copy link

Given that v5.7.1 and v5.7.2 have no release assets, it's a bit hard for me to bisect the changes, but really it seems hardlyu anything has changed, and I am not sure what that laravel change there is: v5.7.0...v5.7.3

Either way while testing a new Cloudron package for 5.7.3 we hit a database migration issue at https://github.com/invoiceninja/invoiceninja/blob/v5-stable/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php#L16C58-L16C58

So other index creations work fine but the DB::raw() type does not seem to be supported suddenly? Changing those to normal index names works as expected. The blueprint stacktrace is and indeed I can't see how the indexName creation would have worked looking at the blueprint code in those sections:

   INFO  Running migrations.  

  2022_10_05_205645_add_indexes_to_client_hash ............................................................................................ 1ms FAIL

In Blueprint.php line 1682:
                                                                                         
  [Error]                                                                                
  Object of class Illuminate\Database\Query\Expression could not be converted to string  
                                                                                         

Exception trace:
  at /app/code/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:1682
 implode() at /app/code/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:1682
 Illuminate\Database\Schema\Blueprint->createIndexName() at /app/code/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:1644
 Illuminate\Database\Schema\Blueprint->indexCommand() at /app/code/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:581
 Illuminate\Database\Schema\Blueprint->index() at /app/code/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php:16
 Illuminate\Database\Migrations\Migration@anonymous\/app/code/database/migrations/2022_10_05_205645_add_indexes_to_client_hash.php:7$1a0->{closure}() at /app/code/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:96
 Illuminate\Database\Schema\Blueprint->__construct() at n/a:n/a
@turbo124
Copy link
Member

Thanks for reporting this.

Fix checked in here #8746

And v5.7.4 has now been tagged

@nebulade
Copy link
Author

Great! Thanks for the super fast fix. I can confirm its working as expected.

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

2 participants