Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"ext-openssl": "*",
"appwrite/appwrite": "19.*",
"utopia-php/database": "5.*",
"utopia-php/storage": "0.18.*",
"utopia-php/storage": "1.0.*",
"utopia-php/dsn": "0.2.*",
"halaxa/json-machine": "^1.2"
},
Expand Down
189 changes: 100 additions & 89 deletions composer.lock

Large diffs are not rendered by default.

42 changes: 25 additions & 17 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,24 +491,32 @@ protected function createField(Column|Attribute $resource): bool
$resource->setStatus(Resource::STATUS_SKIPPED, 'Columns not supported for DocumentsDB');
return false;
}

// column will be matching attribute as well
// column type will be matching attribute type as well
$type = match ($resource->getType()) {
Column::TYPE_DATETIME, Attribute::TYPE_DATETIME => UtopiaDatabase::VAR_DATETIME,
Column::TYPE_BOOLEAN, Attribute::TYPE_BOOLEAN => UtopiaDatabase::VAR_BOOLEAN,
Column::TYPE_INTEGER, Attribute::TYPE_INTEGER => UtopiaDatabase::VAR_INTEGER,
Column::TYPE_FLOAT, Attribute::TYPE_FLOAT => UtopiaDatabase::VAR_FLOAT,
Column::TYPE_RELATIONSHIP, Attribute::TYPE_RELATIONSHIP => UtopiaDatabase::VAR_RELATIONSHIP,
Column::TYPE_STRING, Attribute::TYPE_STRING,
Column::TYPE_IP, Attribute::TYPE_IP,
Column::TYPE_EMAIL, Attribute::TYPE_EMAIL,
Column::TYPE_URL, Attribute::TYPE_URL,
Column::TYPE_ENUM, Attribute::TYPE_ENUM => UtopiaDatabase::VAR_STRING,
Column::TYPE_POINT, Attribute::TYPE_POINT => UtopiaDatabase::VAR_POINT,
Column::TYPE_LINE, Attribute::TYPE_LINE => UtopiaDatabase::VAR_LINESTRING,
Column::TYPE_POLYGON, Attribute::TYPE_POLYGON => UtopiaDatabase::VAR_POLYGON,
Column::TYPE_OBJECT, Attribute::TYPE_OBJECT => UtopiaDatabase::VAR_OBJECT,
Column::TYPE_VECTOR, Attribute::TYPE_VECTOR => UtopiaDatabase::VAR_VECTOR,
default => throw new \Exception('Invalid resource type '.$resource->getType()),
Column::TYPE_DATETIME => UtopiaDatabase::VAR_DATETIME,
Column::TYPE_BOOLEAN => UtopiaDatabase::VAR_BOOLEAN,
Column::TYPE_INTEGER => UtopiaDatabase::VAR_INTEGER,
Column::TYPE_FLOAT => UtopiaDatabase::VAR_FLOAT,
Column::TYPE_RELATIONSHIP => UtopiaDatabase::VAR_RELATIONSHIP,

Column::TYPE_STRING,
Column::TYPE_IP,
Column::TYPE_EMAIL,
Column::TYPE_URL,
Column::TYPE_ENUM => UtopiaDatabase::VAR_STRING,

Column::TYPE_POINT => UtopiaDatabase::VAR_POINT,
Column::TYPE_LINE => UtopiaDatabase::VAR_LINESTRING,
Column::TYPE_POLYGON => UtopiaDatabase::VAR_POLYGON,
Column::TYPE_TEXT => UtopiaDatabase::VAR_TEXT,
Column::TYPE_VARCHAR => UtopiaDatabase::VAR_VARCHAR,
Column::TYPE_MEDIUMTEXT => UtopiaDatabase::VAR_MEDIUMTEXT,
Column::TYPE_LONGTEXT => UtopiaDatabase::VAR_LONGTEXT,
Column::TYPE_OBJECT => UtopiaDatabase::VAR_OBJECT,
Column::TYPE_VECTOR => UtopiaDatabase::VAR_VECTOR,

default => throw new \Exception('Invalid resource type ' . $resource->getType()),
};

$database = $this->dbForProject->getDocument(
Expand Down
105 changes: 0 additions & 105 deletions src/Migration/Resources/Database/Attribute/Decimal.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/Migration/Resources/Database/Attribute/Email.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/Migration/Resources/Database/Attribute/IP.php

This file was deleted.

109 changes: 0 additions & 109 deletions src/Migration/Resources/Database/Attribute/Integer.php

This file was deleted.

Loading