-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix column modifying on columnstore tables #88
Fix column modifying on columnstore tables #88
Conversation
if (version_compare(Application::VERSION, '10.0', '<')) { | ||
throw new LogicException('This database driver does not support modifying columns on Laravel < 10.0.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason, why this is not supported for older versions of Laravel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Older Laravel versions don't support native column modifying, you may check:
- [10.x] Add support for native column modifying laravel/framework#45487
- [11.x] Remove Doctrine DBAL laravel/framework#48864
Laravel was using doctrine/dbal
before this version and I'm quit sure that it is going to be a problem for your package as Doctrine DBAL doesn't support Singlestore. But you may add tests to see if it fallbacks to MySQL correctly or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the latest commit 9777d8a I removed this and added test to see if it works with lower Laravel version + Doctrine DBAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK the tests shows that we can't use doctrine:
SQLSTATE[HY000]: General error: 1706 Feature 'ALTER TABLE CHANGE to modify column type' is not supported by SingleStore. Use MODIFY to change a column's type. (Connection: mysql, SQL: ALTER TABLE test CHANGE data data TEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE
utf8mb4_unicode_ci
)
It looks like |
@AdalbertMemSQL yeah I fixed that function on Laravel 10.30, it was using Doctrine DBAL before that. We can limit that assertion to latest version maybe? |
Yep, that sounds like a good solution |
Fixes #39
Add support for modifying columns on
Note 1: On Laravel 10.x, You have to call
Schema::useNativeSchemaOperationsIfPossible()
method within theboot
method of yourApp\Providers\AppServiceProvider
class. Not needed on Laravel 11.xNote 2: I'm not sure how Singlestore handles indexes and foreign keys of the column being modified, couldn't find anything related on the docs.