Skip to content

Commit 1b5072f

Browse files
committed
Add 1.8.x support
1 parent efcbe59 commit 1b5072f

File tree

7 files changed

+8
-67
lines changed

7 files changed

+8
-67
lines changed

docs/databases.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ POST https://cloud.appwrite.io/v1/databases
2929
| databaseId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
3030
| name | string | Database name. Max length: 128 chars. | |
3131
| enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 |
32-
| type | string | Database type. | tablesdb |
3332

3433

3534
```http request

docs/examples/databases/create.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ $databases = new Databases($client);
1313
$result = $databases->create(
1414
databaseId: '<DATABASE_ID>',
1515
name: '<NAME>',
16-
enabled: false, // optional
17-
type: ::TABLESDB() // optional
16+
enabled: false // optional
1817
);

docs/examples/tablesdb/create.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ $tablesDb = new TablesDb($client);
1313
$result = $tablesDb->create(
1414
databaseId: '<DATABASE_ID>',
1515
name: '<NAME>',
16-
enabled: false, // optional
17-
type: ::TABLESDB() // optional
16+
enabled: false // optional
1817
);

docs/tablesdb.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ POST https://cloud.appwrite.io/v1/tablesdb
2929
| databaseId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
3030
| name | string | Database name. Max length: 128 chars. | |
3131
| enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 |
32-
| type | string | Database type. | tablesdb |
3332

3433

3534
```http request
@@ -591,7 +590,7 @@ PATCH https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/column
591590
GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/indexes
592591
```
593592

594-
** List indexes in the collection. **
593+
** List indexes on the table. **
595594

596595
### Parameters
597596

@@ -607,7 +606,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/indexes
607606
```
608607

609608
** Creates an index on the columns listed. Your index should include all the columns you will query in a single request.
610-
Attributes can be `key`, `fulltext`, and `unique`. **
609+
Type can be `key`, `fulltext`, or `unique`. **
611610

612611
### Parameters
613612

src/Appwrite/Enums/Type.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Appwrite/Services/Databases.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Appwrite\Client;
77
use Appwrite\Service;
88
use Appwrite\InputFile;
9-
use Appwrite\Enums\Type;
109
use Appwrite\Enums\RelationshipType;
1110
use Appwrite\Enums\RelationMutate;
1211
use Appwrite\Enums\IndexType;
@@ -65,14 +64,13 @@ public function list(?array $queries = null, ?string $search = null): array
6564
* @param string $databaseId
6665
* @param string $name
6766
* @param ?bool $enabled
68-
* @param ?Type $type
6967
* @throws AppwriteException
7068
* @return array
7169
*
7270
* @deprecated This API has been deprecated since 1.8.0. Please use `createDatabase` instead.
7371
* @see TablesDb::createDatabase
7472
*/
75-
public function create(string $databaseId, string $name, ?bool $enabled = null, ?Type $type = null): array
73+
public function create(string $databaseId, string $name, ?bool $enabled = null): array
7674
{
7775
$apiPath = str_replace(
7876
[],
@@ -88,10 +86,6 @@ public function create(string $databaseId, string $name, ?bool $enabled = null,
8886
$apiParams['enabled'] = $enabled;
8987
}
9088

91-
if (!is_null($type)) {
92-
$apiParams['type'] = $type;
93-
}
94-
9589
$apiHeaders = [];
9690
$apiHeaders['content-type'] = 'application/json';
9791

src/Appwrite/Services/TablesDb.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Appwrite\Client;
77
use Appwrite\Service;
88
use Appwrite\InputFile;
9-
use Appwrite\Enums\Type;
109
use Appwrite\Enums\RelationshipType;
1110
use Appwrite\Enums\RelationMutate;
1211
use Appwrite\Enums\IndexType;
@@ -62,11 +61,10 @@ public function list(?array $queries = null, ?string $search = null): array
6261
* @param string $databaseId
6362
* @param string $name
6463
* @param ?bool $enabled
65-
* @param ?Type $type
6664
* @throws AppwriteException
6765
* @return array
6866
*/
69-
public function create(string $databaseId, string $name, ?bool $enabled = null, ?Type $type = null): array
67+
public function create(string $databaseId, string $name, ?bool $enabled = null): array
7068
{
7169
$apiPath = str_replace(
7270
[],
@@ -82,10 +80,6 @@ public function create(string $databaseId, string $name, ?bool $enabled = null,
8280
$apiParams['enabled'] = $enabled;
8381
}
8482

85-
if (!is_null($type)) {
86-
$apiParams['type'] = $type;
87-
}
88-
8983
$apiHeaders = [];
9084
$apiHeaders['content-type'] = 'application/json';
9185

@@ -1461,7 +1455,7 @@ public function updateRelationshipColumn(string $databaseId, string $tableId, st
14611455
}
14621456

14631457
/**
1464-
* List indexes in the collection.
1458+
* List indexes on the table.
14651459
*
14661460
* @param string $databaseId
14671461
* @param string $tableId
@@ -1498,7 +1492,7 @@ public function listIndexes(string $databaseId, string $tableId, ?array $queries
14981492
/**
14991493
* Creates an index on the columns listed. Your index should include all the
15001494
* columns you will query in a single request.
1501-
* Attributes can be `key`, `fulltext`, and `unique`.
1495+
* Type can be `key`, `fulltext`, or `unique`.
15021496
*
15031497
* @param string $databaseId
15041498
* @param string $tableId

0 commit comments

Comments
 (0)