Skip to content

Commit 99dfbdf

Browse files
committed
Fix migration for SQLite compatibility
Use string columns instead of uuid/ulid types which SQLite doesn't support.
1 parent 7be939c commit 99dfbdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/Core/Database/Eloquent/Concerns/migrations/2025_01_01_000000_create_has_uuids_test_models.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
return new class extends Migration {
1010
public function up(): void
1111
{
12+
// Use string(36) for UUID and string(26) for ULID for SQLite compatibility
1213
Schema::create('has_uuids_test_models', function (Blueprint $table) {
13-
$table->uuid('id')->primary();
14+
$table->string('id', 36)->primary();
1415
$table->string('name');
1516
$table->timestamps();
1617
});
1718

1819
Schema::create('has_ulids_test_models', function (Blueprint $table) {
19-
$table->ulid('id')->primary();
20+
$table->string('id', 26)->primary();
2021
$table->string('name');
2122
$table->timestamps();
2223
});

0 commit comments

Comments
 (0)