mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: resolve MongoDB-specific E2E test failures and $sequence type bug
- Fix $sequence always cast to string (was incorrectly cast to int for numeric values) in Document.php and Row.php - Add supportForMultipleFulltextIndexes, supportForAttributeResizing, supportForSchemas console variables for MongoDB adapter - Fix testCreateIndexes to use getSupportForMultipleFulltextIndexes() instead of getSupportForRelationships() for fulltext index error branching - Fix testAttributeRowWidthLimit/testColumnRowWidthLimit to skip on databases without schema support (MongoDB) - Fix testAttributeUpdateStringResize/testColumnUpdateStringResize to skip on databases without attribute resizing support (MongoDB) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
436ced3f1f
commit
bf68bb2f71
@@ -97,6 +97,9 @@ class Get extends Action
|
||||
'supportForSpatials' => $adapter->getSupportForSpatialAttributes(),
|
||||
'supportForSpatialIndexNull' => $adapter->getSupportForSpatialIndexNull(),
|
||||
'supportForFulltextWildcard' => $adapter->getSupportForFulltextWildcardIndex(),
|
||||
'supportForMultipleFulltextIndexes' => $adapter->getSupportForMultipleFulltextIndexes(),
|
||||
'supportForAttributeResizing' => $adapter->getSupportForAttributeResizing(),
|
||||
'supportForSchemas' => $adapter->getSupportForSchemas(),
|
||||
'maxIndexLength' => $adapter->getMaxIndexLength(),
|
||||
]);
|
||||
|
||||
|
||||
@@ -160,6 +160,33 @@ class ConsoleVariables extends Model
|
||||
'example' => true,
|
||||
]
|
||||
)
|
||||
->addRule(
|
||||
'supportForMultipleFulltextIndexes',
|
||||
[
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Whether the database adapter supports multiple fulltext indexes per collection.',
|
||||
'default' => true,
|
||||
'example' => true,
|
||||
]
|
||||
)
|
||||
->addRule(
|
||||
'supportForAttributeResizing',
|
||||
[
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Whether the database adapter supports resizing attributes.',
|
||||
'default' => true,
|
||||
'example' => true,
|
||||
]
|
||||
)
|
||||
->addRule(
|
||||
'supportForSchemas',
|
||||
[
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Whether the database adapter supports fixed schemas with row width limits.',
|
||||
'default' => true,
|
||||
'example' => true,
|
||||
]
|
||||
)
|
||||
->addRule(
|
||||
'maxIndexLength',
|
||||
[
|
||||
|
||||
@@ -85,7 +85,7 @@ class Document extends Any
|
||||
|
||||
if (!$document->isEmpty()) {
|
||||
$sequence = $document->getAttribute('$sequence', '');
|
||||
$document->setAttribute('$sequence', \is_numeric($sequence) ? (int)$sequence : (string)$sequence);
|
||||
$document->setAttribute('$sequence', (string)$sequence);
|
||||
}
|
||||
|
||||
foreach ($document->getAttributes() as $attribute) {
|
||||
|
||||
@@ -83,7 +83,7 @@ class Row extends Any
|
||||
$document->removeAttribute('$collection');
|
||||
$document->removeAttribute('$tenant');
|
||||
$sequence = $document->getAttribute('$sequence', '');
|
||||
$document->setAttribute('$sequence', \is_numeric($sequence) ? (int)$sequence : (string)$sequence);
|
||||
$document->setAttribute('$sequence', (string)$sequence);
|
||||
|
||||
foreach ($document->getAttributes() as $column) {
|
||||
if (\is_array($column)) {
|
||||
|
||||
Reference in New Issue
Block a user