mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add LEGACY constant and update database type references
- Introduced a new constant `LEGACY` in Constants.php. - Updated `databaseType` in Action classes to use `LEGACY` instead of `TABLESDB`. - Cleaned up duplicate parameter definition in Create.php for transactionId.
This commit is contained in:
@@ -23,6 +23,7 @@ const DOCUMENTS = 'document';
|
||||
const ATTRIBUTES = 'attribute';
|
||||
const COLLECTIONS = 'collection';
|
||||
|
||||
const LEGACY = 'legacy';
|
||||
const TABLESDB = 'tablesdb';
|
||||
const DOCUMENTSDB = 'documentsdb';
|
||||
const VECTORDB = 'vectordb';
|
||||
|
||||
@@ -15,7 +15,7 @@ abstract class Action extends UtopiaAction
|
||||
*/
|
||||
private ?string $context = COLLECTIONS;
|
||||
|
||||
private ?string $databaseType = TABLESDB;
|
||||
private ?string $databaseType = LEGACY;
|
||||
|
||||
/**
|
||||
* Get the response model used in the SDK and HTTP responses.
|
||||
|
||||
+1
-2
@@ -110,8 +110,7 @@ class Create extends Action
|
||||
new Parameter('databaseId', optional: false),
|
||||
new Parameter('collectionId', optional: false),
|
||||
new Parameter('documents', optional: false),
|
||||
new Parameter('transactionId', optional: true),
|
||||
new Parameter('transactionId', optional: true),
|
||||
new Parameter('transactionId', optional: true)
|
||||
],
|
||||
deprecated: new Deprecated(
|
||||
since: '1.8.0',
|
||||
|
||||
@@ -10,7 +10,7 @@ abstract class Action extends DatabasesAction
|
||||
* The current API context (either 'table' or 'collection').
|
||||
*/
|
||||
private ?string $context = COLLECTIONS;
|
||||
private ?string $databaseType = TABLESDB;
|
||||
private ?string $databaseType = LEGACY;
|
||||
|
||||
public function getDatabaseType(): string
|
||||
{
|
||||
@@ -19,7 +19,7 @@ abstract class Action extends DatabasesAction
|
||||
|
||||
protected function getDatabasesOperationWriteMetric(): string
|
||||
{
|
||||
if ($this->databaseType === DATABASE_TYPE_LEGACY || $this->databaseType === TABLESDB) {
|
||||
if ($this->databaseType === LEGACY || $this->databaseType === TABLESDB) {
|
||||
return METRIC_DATABASES_OPERATIONS_WRITES;
|
||||
}
|
||||
return $this->databaseType.'.'.METRIC_DATABASES_OPERATIONS_WRITES;
|
||||
@@ -27,7 +27,7 @@ abstract class Action extends DatabasesAction
|
||||
}
|
||||
protected function getDatabasesIdOperationWriteMetric(): string
|
||||
{
|
||||
if ($this->databaseType === DATABASE_TYPE_LEGACY || $this->databaseType === TABLESDB) {
|
||||
if ($this->databaseType === LEGACY || $this->databaseType === TABLESDB) {
|
||||
return METRIC_DATABASE_ID_OPERATIONS_WRITES;
|
||||
}
|
||||
return $this->databaseType.'.'.METRIC_DATABASE_ID_OPERATIONS_WRITES;
|
||||
@@ -36,7 +36,6 @@ abstract class Action extends DatabasesAction
|
||||
public function setHttpPath(string $path): DatabasesAction
|
||||
{
|
||||
switch (true) {
|
||||
// TODO: set the getDatabaseType() from each database group instead of path matching
|
||||
case str_contains($path, '/tablesdb'):
|
||||
$this->context = TABLES;
|
||||
$this->databaseType = TABLESDB;
|
||||
|
||||
Reference in New Issue
Block a user