Skip to content

Commit a14719f

Browse files
committed
fix: compatability to Laravel 11.25 (resolves #100)
1 parent a6783c5 commit a14719f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.0.0] - 2024-09-27
8+
### Backward Incompatible Changes
9+
* The dimensions value for the `vector` migration type is now required to copy the behavior of Laravel 11.25.0
10+
711
## [1.1.1] - 2024-09-23
812
### Fixed
913
* Support PostgreSQL's `^@` starts with operator.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,9 @@ Schema::create('comments', function (Blueprint $table) {
13341334

13351335
# Breaking Changes
13361336

1337+
* **2.0.0**
1338+
* Laravel 11.25 released a new `vector` migration type so the behaviour had to be aligned with Laravel's implementation:
1339+
* The `$dimensions` parameter (formerly with a default of 1536) is now required
13371340
* **1.0.0**
13381341
* Laravel 11.17 released a new `whereLike` and `orWhereLike` builder method so the behaviour had to be aligned with Laravel's implementation:
13391342
* The value is now searched case-insensitive by default instead of case-sensitive

src/Schema/BlueprintTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function varbit(string $column, ?int $length = null): ColumnDefinition
251251
/**
252252
* Create a new vector column on the table.
253253
*/
254-
public function vector(string $column, int $dimensions = 1536): ColumnDefinition
254+
public function vector($column, $dimensions): ColumnDefinition
255255
{
256256
return $this->addColumn('vector', $column, compact('dimensions'));
257257
}

tests/Migration/TypesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ public function testVectorTypeIsSupported(): void
375375

376376
$this->getConnection()->statement('CREATE EXTENSION IF NOT EXISTS vector');
377377
$queries = $this->runMigrations(
378-
fnCreate: fn (Blueprint $table) => $table->vector('col'),
379-
fnChange: fn (Blueprint $table) => $table->vector('col')->change(),
378+
fnCreate: fn (Blueprint $table) => $table->vector('col', 1536),
379+
fnChange: fn (Blueprint $table) => $table->vector('col', 1536)->change(),
380380
);
381381

382382
$this->assertEquals('create table "test" ("col" vector(1536) not null)', $queries[0]['query'] ?? null);

0 commit comments

Comments
 (0)