- Notifications
You must be signed in to change notification settings - Fork11.7k
[12.x] Add native JSON column type support for SQL Server 2025+#58105
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
taylorotwell commentedDec 12, 2025
Tests are failing. |
| $column =new \Illuminate\Support\Fluent(['name' =>'data','type' =>'json']); | ||
| // Assert that the Grammar returns the native JSON type. | ||
| $this->assertEquals('json',$grammar->typeJson($column)); |
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.
Tests seem to be failing as theSqlServerGrammar@typeJson() method is protected and thus cannot be called here.
You can take a look on how the MySQL Schema Grammar is tested for the UUID fields (Illuminate\Tests\Database\DatabaseMySqlSchemaGrammarTest).
It tests against theBlueprint statements, which should suffice for this case too.
Fixes#57965
This PR implements version detection in SqlServerGrammar to utilize the native JSON datatype for SQL Server 2025+ while maintaining the nvarchar(max) fallback for older versions, as requested in the issue.