mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge branch 'revert-revert-8946-chore-update-database' into feat-migration
# Conflicts: # composer.json # composer.lock
This commit is contained in:
commit
aa2385ffb9
3 changed files with 6 additions and 4 deletions
|
|
@ -686,7 +686,7 @@ return [
|
||||||
],
|
],
|
||||||
Exception::ATTRIBUTE_LIMIT_EXCEEDED => [
|
Exception::ATTRIBUTE_LIMIT_EXCEEDED => [
|
||||||
'name' => Exception::ATTRIBUTE_LIMIT_EXCEEDED,
|
'name' => Exception::ATTRIBUTE_LIMIT_EXCEEDED,
|
||||||
'description' => 'The maximum number of attributes has been reached.',
|
'description' => 'The maximum number or size of attributes for this collection has been reached.',
|
||||||
'code' => 400,
|
'code' => 400,
|
||||||
],
|
],
|
||||||
Exception::ATTRIBUTE_VALUE_INVALID => [
|
Exception::ATTRIBUTE_VALUE_INVALID => [
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att
|
||||||
} catch (DuplicateException) {
|
} catch (DuplicateException) {
|
||||||
throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS);
|
throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS);
|
||||||
} catch (LimitException) {
|
} catch (LimitException) {
|
||||||
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute limit exceeded');
|
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $collectionId);
|
$dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $collectionId);
|
||||||
$dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $collection->getInternalId());
|
$dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $collection->getInternalId());
|
||||||
|
|
@ -197,7 +197,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att
|
||||||
throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS);
|
throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS);
|
||||||
} catch (LimitException) {
|
} catch (LimitException) {
|
||||||
$dbForProject->deleteDocument('attributes', $attribute->getId());
|
$dbForProject->deleteDocument('attributes', $attribute->getId());
|
||||||
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute limit exceeded');
|
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $relatedCollection->getId());
|
$dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $relatedCollection->getId());
|
||||||
$dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $relatedCollection->getInternalId());
|
$dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $relatedCollection->getInternalId());
|
||||||
|
|
@ -393,6 +393,8 @@ function updateAttribute(
|
||||||
throw new Exception(Exception::ATTRIBUTE_INVALID_RESIZE);
|
throw new Exception(Exception::ATTRIBUTE_INVALID_RESIZE);
|
||||||
} catch (NotFoundException) {
|
} catch (NotFoundException) {
|
||||||
throw new Exception(Exception::ATTRIBUTE_NOT_FOUND);
|
throw new Exception(Exception::ATTRIBUTE_NOT_FOUND);
|
||||||
|
} catch (LimitException) {
|
||||||
|
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1362,7 +1362,7 @@ class DatabasesCustomServerTest extends Scope
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals(400, $tooWide['headers']['status-code']);
|
$this->assertEquals(400, $tooWide['headers']['status-code']);
|
||||||
$this->assertEquals('Attribute limit exceeded', $tooWide['body']['message']);
|
$this->assertEquals('attribute_limit_exceeded', $tooWide['body']['type']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIndexLimitException()
|
public function testIndexLimitException()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue