Skip to content

Commit 706f3b9

Browse files
abnegateclaude
andcommitted
fix: change $tenant internal attribute type from VAR_INTEGER to VAR_ID
VAR_ID is adapter-aware and uses the Sequence validator, which accepts integer strings for SQL adapters and UUID7 strings for MongoDB. This fixes StructureException when creating collections with shared tables on MongoDB, where tenant values are UUID7-format strings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d9ef23f commit 706f3b9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Database/Database.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ class Database
251251
],
252252
[
253253
'$id' => '$tenant',
254-
'type' => self::VAR_INTEGER,
255-
//'type' => self::VAR_ID, // Inconsistency with other VAR_ID since this is an INT
254+
'type' => self::VAR_ID,
256255
'size' => 0,
257256
'required' => false,
258257
'default' => null,

src/Database/Validator/Structure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class Structure extends Validator
5252
],
5353
[
5454
'$id' => '$tenant',
55-
'type' => Database::VAR_INTEGER, // ? VAR_ID
56-
'size' => 8,
55+
'type' => Database::VAR_ID,
56+
'size' => 0,
5757
'required' => false,
5858
'default' => null,
59-
'signed' => false,
59+
'signed' => true,
6060
'array' => false,
6161
'filters' => [],
6262
],

0 commit comments

Comments
 (0)