mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
Merge branch '0.13.x' of github.com:appwrite/appwrite into frontend-fixes
This commit is contained in:
commit
1e40c7e256
32 changed files with 578 additions and 129 deletions
67
CHANGES.md
67
CHANGES.md
|
|
@ -1,17 +1,58 @@
|
|||
# Unreleased Version 0.13.0
|
||||
# Version 0.13.0
|
||||
|
||||
## Features
|
||||
### Functions
|
||||
- Synchronous function execution
|
||||
- Improved functions execution times by alot
|
||||
- Added a new worker to build deployments
|
||||
- Functions are now executed differently and your functions need to be adapted **Breaking Change**
|
||||
- Tags are now called Deployments **Breaking Change**
|
||||
- Renamed `tagId` to `deplyomentId` in collections **Breaking Change**
|
||||
- Updated event names from `function.tags.*` to `function.deployments.*` **Breaking Change**
|
||||
### Storage
|
||||
- Added Buckets
|
||||
- Buckets allow you to configure following settings:
|
||||
- Maximum File Size
|
||||
- Enabled/Disabled
|
||||
- Encryption
|
||||
- Anti Virus
|
||||
- Allowed file extensions
|
||||
- Permissions
|
||||
- Bucket Level
|
||||
- File Level
|
||||
- Support for S3 and Digitalocean Spaces
|
||||
- Support for large files
|
||||
- Files larger then 5MB will be automatically uploaded in chunks
|
||||
- New UI in the console for uploading files with progress indication
|
||||
|
||||
### Account
|
||||
- Renamed `providerToken` to `providerAccessToken` in sessions **Breaking Change**
|
||||
- New endpoint to refresh the OAuth Access Token
|
||||
- OAuth sessions now include `providerAccessTokenExpiry` and `providerRefreshToken`
|
||||
- Notion and Strip have been added to the OAuth Providers
|
||||
- Microsoft OAuth provider now supports custom domains
|
||||
|
||||
## Bugs
|
||||
- Fixed permission issues and is now more consistent and returns all resources
|
||||
- Fixed total amount of documents not being updated
|
||||
- Fixed issue with searching though memberships
|
||||
- Fixed image preview rotation
|
||||
- Fixed Database index names that contain SQL keywords
|
||||
- Fixed UI to reveal long e-mail addresses on User list
|
||||
- Fixed UI for Attribute default value field to reset after submit
|
||||
- Fixed UI to check for new available version of Appwrite
|
||||
- Fixed UI default values when creating Integer or Float attributes
|
||||
|
||||
|
||||
## Security
|
||||
- Remove `appwrite.io` and `appwrite.test` from authorized domains for session verification
|
||||
|
||||
## Upgrades
|
||||
|
||||
- Upgraded `redis` extenstion to version 5.3.7
|
||||
- Upgraded `swoole` extenstion to version 4.8.7
|
||||
- Upgraded GEO IP database to version March 2022
|
||||
|
||||
- Added ability to create syncronous function executions
|
||||
- Introduced new execution model for functions
|
||||
- Improved functions execution times
|
||||
- Improved functions execution times
|
||||
- Create a new builds worker to handle building of deployments
|
||||
- **[ Breaking ]** **Tags** have been renamed to **Deployments**
|
||||
- Rename `tagId` to `deplyomentId` in collections
|
||||
- Rename tags to deployments in the docs
|
||||
- Updated endpoints to reflect the new terminology
|
||||
- Updated UI with these changes
|
||||
- Updated event names from `function.tags.*` to `function.deployments.*`
|
||||
|
||||
# Version 0.12.3
|
||||
|
||||
## Bugs
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ FROM php:8.0.14-cli-alpine3.15 as compile
|
|||
ARG DEBUG=false
|
||||
ENV DEBUG=$DEBUG
|
||||
|
||||
ENV PHP_REDIS_VERSION=5.3.5 \
|
||||
ENV PHP_REDIS_VERSION=5.3.7 \
|
||||
PHP_MONGODB_VERSION=1.9.1 \
|
||||
PHP_SWOOLE_VERSION=v4.8.5 \
|
||||
PHP_SWOOLE_VERSION=v4.8.7 \
|
||||
PHP_IMAGICK_VERSION=3.7.0 \
|
||||
PHP_YAML_VERSION=2.2.2 \
|
||||
PHP_MAXMINDDB_VERSION=v1.11.0
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
app/db/DBIP/dbip-country-lite-2022-03.mmdb
Normal file
BIN
app/db/DBIP/dbip-country-lite-2022-03.mmdb
Normal file
Binary file not shown.
|
|
@ -70,8 +70,8 @@ const APP_LIMIT_ANTIVIRUS = 20000000; //20MB
|
|||
const APP_LIMIT_ENCRYPTION = 20000000; //20MB
|
||||
const APP_LIMIT_COMPRESSION = 20000000; //20MB
|
||||
const APP_LIMIT_PREVIEW = 10000000; //10MB file size limit for preview endpoint
|
||||
const APP_CACHE_BUSTER = 201;
|
||||
const APP_VERSION_STABLE = '0.12.3';
|
||||
const APP_CACHE_BUSTER = 300;
|
||||
const APP_VERSION_STABLE = '0.13.0';
|
||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||
|
|
@ -469,7 +469,7 @@ $register->set('smtp', function () {
|
|||
return $mail;
|
||||
});
|
||||
$register->set('geodb', function () {
|
||||
return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2021-12.mmdb');
|
||||
return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2022-03.mmdb');
|
||||
});
|
||||
$register->set('db', function () { // This is usually for our workers or CLI commands scope
|
||||
$dbHost = App::getEnv('_APP_DB_HOST', '');
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
->setTwitter(APP_SOCIAL_TWITTER_HANDLE)
|
||||
->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD)
|
||||
->setDefaultHeaders([
|
||||
'X-Appwrite-Response-Format' => '0.12.0',
|
||||
'X-Appwrite-Response-Format' => '0.13.0',
|
||||
]);
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@
|
|||
"utopia-php/image": "0.5.*",
|
||||
"utopia-php/orchestration": "0.4.*",
|
||||
"resque/php-resque": "1.3.6",
|
||||
"matomo/device-detector": "5.0.1",
|
||||
"dragonmantank/cron-expression": "3.1.0",
|
||||
"matomo/device-detector": "5.0.4",
|
||||
"dragonmantank/cron-expression": "3.3.1",
|
||||
"influxdb/influxdb-php": "1.15.2",
|
||||
"phpmailer/phpmailer": "6.5.3",
|
||||
"chillerlan/php-qrcode": "4.3.2",
|
||||
"phpmailer/phpmailer": "6.6.0",
|
||||
"chillerlan/php-qrcode": "4.3.3",
|
||||
"adhocore/jwt": "1.1.2",
|
||||
"slickdeals/statsd": "3.1.0"
|
||||
},
|
||||
|
|
|
|||
69
composer.lock
generated
69
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b7919cd5b669605d051fadd3818523a7",
|
||||
"content-hash": "5c49f5a1c672afd4deeead22dc18a06d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
|
@ -158,16 +158,16 @@
|
|||
},
|
||||
{
|
||||
"name": "chillerlan/php-qrcode",
|
||||
"version": "4.3.2",
|
||||
"version": "4.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chillerlan/php-qrcode.git",
|
||||
"reference": "b625396e0752d79747a55205ae7e191eeb459dcd"
|
||||
"reference": "6356b246948ac1025882b3f55e7c68ebd4515ae3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/b625396e0752d79747a55205ae7e191eeb459dcd",
|
||||
"reference": "b625396e0752d79747a55205ae7e191eeb459dcd",
|
||||
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/6356b246948ac1025882b3f55e7c68ebd4515ae3",
|
||||
"reference": "6356b246948ac1025882b3f55e7c68ebd4515ae3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/chillerlan/php-qrcode/issues",
|
||||
"source": "https://github.com/chillerlan/php-qrcode/tree/4.3.2"
|
||||
"source": "https://github.com/chillerlan/php-qrcode/tree/4.3.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -232,7 +232,7 @@
|
|||
"type": "ko_fi"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-18T08:46:03+00:00"
|
||||
"time": "2021-11-25T22:38:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "chillerlan/php-settings-container",
|
||||
|
|
@ -416,29 +416,29 @@
|
|||
},
|
||||
{
|
||||
"name": "dragonmantank/cron-expression",
|
||||
"version": "v3.1.0",
|
||||
"version": "v3.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dragonmantank/cron-expression.git",
|
||||
"reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c"
|
||||
"reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c",
|
||||
"reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c",
|
||||
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/be85b3f05b46c39bbc0d95f6c071ddff669510fa",
|
||||
"reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2|^8.0",
|
||||
"webmozart/assert": "^1.7.0"
|
||||
"webmozart/assert": "^1.0"
|
||||
},
|
||||
"replace": {
|
||||
"mtdowling/cron-expression": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "^0.12",
|
||||
"phpstan/phpstan-webmozart-assert": "^0.12.7",
|
||||
"phpstan/phpstan": "^1.0",
|
||||
"phpstan/phpstan-webmozart-assert": "^1.0",
|
||||
"phpunit/phpunit": "^7.0|^8.0|^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
|
|
@ -465,7 +465,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dragonmantank/cron-expression/issues",
|
||||
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0"
|
||||
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -473,7 +473,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-11-24T19:55:57+00:00"
|
||||
"time": "2022-01-18T15:43:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
|
|
@ -921,16 +921,16 @@
|
|||
},
|
||||
{
|
||||
"name": "matomo/device-detector",
|
||||
"version": "5.0.1",
|
||||
"version": "5.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/matomo-org/device-detector.git",
|
||||
"reference": "ebd8a07e4b69088c0e34f29ec72dc162c34c9264"
|
||||
"reference": "99ea1953fc7f23f785e593ce1499a00586645530"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/ebd8a07e4b69088c0e34f29ec72dc162c34c9264",
|
||||
"reference": "ebd8a07e4b69088c0e34f29ec72dc162c34c9264",
|
||||
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/99ea1953fc7f23f785e593ce1499a00586645530",
|
||||
"reference": "99ea1953fc7f23f785e593ce1499a00586645530",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -942,7 +942,7 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"matthiasmullie/scrapbook": "^1.4.7",
|
||||
"mayflower/mo4-coding-standard": "dev-master#275cb9d",
|
||||
"mayflower/mo4-coding-standard": "^v8.0.0",
|
||||
"phpstan/phpstan": "^0.12.52",
|
||||
"phpunit/phpunit": "^8.5.8",
|
||||
"psr/cache": "^1.0.1",
|
||||
|
|
@ -986,7 +986,7 @@
|
|||
"source": "https://github.com/matomo-org/matomo",
|
||||
"wiki": "https://dev.matomo.org/"
|
||||
},
|
||||
"time": "2021-12-07T11:40:16+00:00"
|
||||
"time": "2022-02-18T19:51:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mongodb/mongodb",
|
||||
|
|
@ -1108,16 +1108,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.5.3",
|
||||
"version": "v6.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "baeb7cde6b60b1286912690ab0693c7789a31e71"
|
||||
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/baeb7cde6b60b1286912690ab0693c7789a31e71",
|
||||
"reference": "baeb7cde6b60b1286912690ab0693c7789a31e71",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1",
|
||||
"reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1130,10 +1130,10 @@
|
|||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||
"doctrine/annotations": "^1.2",
|
||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.1",
|
||||
"phpcompatibility/php-compatibility": "^9.3.5",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"squizlabs/php_codesniffer": "^3.6.0",
|
||||
"squizlabs/php_codesniffer": "^3.6.2",
|
||||
"yoast/phpunit-polyfills": "^1.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
|
|
@ -1174,7 +1174,7 @@
|
|||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.3"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -1182,7 +1182,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-25T16:34:11+00:00"
|
||||
"time": "2022-02-28T15:31:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
|
|
@ -3075,7 +3075,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "3af54e71d0088b72b3223efc511b77e254fb7a1d"
|
||||
"reference": "111fb88713797c58b4e6875c43b2d3f6bd95d1d2"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
|
@ -3110,7 +3110,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2022-03-01T09:53:31+00:00"
|
||||
"time": "2022-03-01T12:45:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
|
|
@ -3685,6 +3685,9 @@
|
|||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"replace": {
|
||||
"myclabs/deep-copy": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.0",
|
||||
"doctrine/common": "^2.6",
|
||||
|
|
@ -6570,5 +6573,5 @@
|
|||
"platform-overrides": {
|
||||
"php": "8.0"
|
||||
},
|
||||
"plugin-api-version": "2.2.0"
|
||||
"plugin-api-version": "2.1.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.updateSession('[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', document.getElementById('uploader').files[0], false);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.listDeployments('[FUNCTION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
const sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
|
|
@ -5,10 +5,6 @@ sdk
|
|||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]');
|
||||
let result = sdk.storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
||||
console.log(result); // Resource URL
|
||||
28
package-lock.json
generated
28
package-lock.json
generated
|
|
@ -9,10 +9,10 @@
|
|||
"version": "0.1.0",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"chart.js": "^3.7.0",
|
||||
"chart.js": "^3.7.1",
|
||||
"markdown-it": "^12.3.2",
|
||||
"pell": "^1.0.6",
|
||||
"prismjs": "^1.26.0",
|
||||
"prismjs": "^1.27.0",
|
||||
"turndown": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -549,9 +549,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/chart.js": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.0.tgz",
|
||||
"integrity": "sha512-31gVuqqKp3lDIFmzpKIrBeum4OpZsQjSIAqlOpgjosHDJZlULtvwLEZKtEhIAZc7JMPaHlYMys40Qy9Mf+1AAg=="
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.1.tgz",
|
||||
"integrity": "sha512-8knRegQLFnPQAheZV8MjxIXc5gQEfDFD897BJgv/klO/vtIyFFmgMXrNfgrXpbTr/XbTturxRgxIXx/Y+ASJBA=="
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "2.1.8",
|
||||
|
|
@ -3566,9 +3566,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/prismjs": {
|
||||
"version": "1.26.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.26.0.tgz",
|
||||
"integrity": "sha512-HUoH9C5Z3jKkl3UunCyiD5jwk0+Hz0fIgQ2nbwU2Oo/ceuTAQAg+pPVnfdt2TJWRVLcxKh9iuoYDUSc8clb5UQ==",
|
||||
"version": "1.27.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz",
|
||||
"integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
|
|
@ -5487,9 +5487,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"chart.js": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.0.tgz",
|
||||
"integrity": "sha512-31gVuqqKp3lDIFmzpKIrBeum4OpZsQjSIAqlOpgjosHDJZlULtvwLEZKtEhIAZc7JMPaHlYMys40Qy9Mf+1AAg=="
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.1.tgz",
|
||||
"integrity": "sha512-8knRegQLFnPQAheZV8MjxIXc5gQEfDFD897BJgv/klO/vtIyFFmgMXrNfgrXpbTr/XbTturxRgxIXx/Y+ASJBA=="
|
||||
},
|
||||
"chokidar": {
|
||||
"version": "2.1.8",
|
||||
|
|
@ -7981,9 +7981,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"prismjs": {
|
||||
"version": "1.26.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.26.0.tgz",
|
||||
"integrity": "sha512-HUoH9C5Z3jKkl3UunCyiD5jwk0+Hz0fIgQ2nbwU2Oo/ceuTAQAg+pPVnfdt2TJWRVLcxKh9iuoYDUSc8clb5UQ=="
|
||||
"version": "1.27.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz",
|
||||
"integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
"gulp-less": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chart.js": "^3.7.0",
|
||||
"chart.js": "^3.7.1",
|
||||
"markdown-it": "^12.3.2",
|
||||
"pell": "^1.0.6",
|
||||
"prismjs": "^1.26.0",
|
||||
"prismjs": "^1.27.0",
|
||||
"turndown": "^7.1.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
public/dist/scripts/app-all.js
vendored
8
public/dist/scripts/app-all.js
vendored
File diff suppressed because one or more lines are too long
8
public/dist/scripts/app-dep.js
vendored
8
public/dist/scripts/app-dep.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -49,7 +49,7 @@
|
|||
};
|
||||
this.headers = {
|
||||
'x-sdk-version': 'appwrite:web:4.0.4',
|
||||
'X-Appwrite-Response-Format': '0.12.0',
|
||||
'X-Appwrite-Response-Format': '0.13.0',
|
||||
};
|
||||
this.realtime = {
|
||||
socket: undefined,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
namespace Appwrite\Migration\Version;
|
||||
|
||||
use Appwrite\Migration\Migration;
|
||||
use Utopia\App;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
class V12 extends Migration
|
||||
{
|
||||
|
|
@ -35,6 +37,7 @@ class V12 extends Migration
|
|||
Console::info('Migrating Permissions');
|
||||
$this->fixPermissions();
|
||||
Console::info('Migrating Collections');
|
||||
$this->migrateCustomCollections();
|
||||
$this->fixCollections();
|
||||
Console::info('Migrating Documents');
|
||||
$this->forEachDocument([$this, 'fixDocument']);
|
||||
|
|
@ -54,7 +57,7 @@ class V12 extends Migration
|
|||
* Remove empty generated Console Project.
|
||||
*/
|
||||
if ($this->consoleDB->getNamespace() === '_project_console' && $projectId === 'console') {
|
||||
$all = [];
|
||||
$all = ['_console_bucket_1', '_console_bucket_1_perms'];
|
||||
foreach ($this->collections as $collection) {
|
||||
$all[] = "_{$projectId}_{$collection['$id']}";
|
||||
$all[] = "_{$projectId}_{$collection['$id']}_perms";
|
||||
|
|
@ -70,6 +73,13 @@ class V12 extends Migration
|
|||
foreach ($this->collections as $collection) {
|
||||
$id = $collection['$id'];
|
||||
|
||||
/**
|
||||
* Skip new tables that don't exists on old schema.
|
||||
*/
|
||||
if (in_array($id, ['buckets', 'deployments', 'builds'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->pdo->prepare("ALTER TABLE IF EXISTS _project_{$projectId}_{$id} RENAME TO _{$projectId}_{$id}")->execute();
|
||||
$this->pdo->prepare("CREATE TABLE IF NOT EXISTS _{$projectId}_{$id}_perms (
|
||||
`_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
|
|
@ -92,32 +102,294 @@ class V12 extends Migration
|
|||
{
|
||||
foreach ($this->collections as $collection) {
|
||||
$id = $collection['$id'];
|
||||
|
||||
/**
|
||||
* Skip new tables that don't exists on old schema.
|
||||
*/
|
||||
if (in_array($id, ['buckets', 'deployments', 'builds'])) {
|
||||
continue;
|
||||
}
|
||||
Console::log("- {$id}");
|
||||
switch ($id) {
|
||||
case 'sessions':
|
||||
try {
|
||||
/**
|
||||
* Rename providerToken to providerAccessToken
|
||||
*/
|
||||
$this->projectDB->renameAttribute($id, 'providerToken', 'providerAccessToken');
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'providerAccessToken' from {$id}: {$th->getMessage()}");
|
||||
}
|
||||
try {
|
||||
/**
|
||||
* Create providerRefreshToken
|
||||
*/
|
||||
$this->projectDB->createAttribute(collection: $id, id: 'providerRefreshToken', type: Database::VAR_STRING, size: 16384, signed: true, required: true, filters: ['encrypt']);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'providerRefreshToken' from {$id}: {$th->getMessage()}");
|
||||
}
|
||||
try {
|
||||
/**
|
||||
* Create providerAccessTokenExpiry
|
||||
*/
|
||||
$this->projectDB->createAttribute(collection: $id, id: 'providerAccessTokenExpiry', type: Database::VAR_INTEGER, size: 0, required: true);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'providerAccessTokenExpiry' from {$id}: {$th->getMessage()}");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'memberships':
|
||||
try {
|
||||
/**
|
||||
* Add search attribute and index to memberships.
|
||||
*/
|
||||
$this->projectDB->createAttribute(collection: $id, id: 'search', type: Database::VAR_STRING, size: 16384, required: false);
|
||||
$this->projectDB->createIndex(collection: $id, id: '_key_search', type: Database::INDEX_FULLTEXT, attributes: ['search']);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'search' from {$id}: {$th->getMessage()}");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'files':
|
||||
/**
|
||||
* Create bucket table if not exists.
|
||||
*/
|
||||
$this->createCollection('buckets');
|
||||
|
||||
if (!$this->projectDB->findOne('buckets', [new Query('$id', Query::TYPE_EQUAL, ['default'])])) {
|
||||
$this->projectDB->createDocument('buckets', new Document([
|
||||
'$id' => 'default',
|
||||
'$collection' => 'buckets',
|
||||
'dateCreated' => \time(),
|
||||
'dateUpdated' => \time(),
|
||||
'name' => 'Default',
|
||||
'permission' => 'file',
|
||||
'maximumFileSize' => (int) App::getEnv('_APP_STORAGE_LIMIT', 0), // 10MB
|
||||
'allowedFileExtensions' => [],
|
||||
'enabled' => true,
|
||||
'encryption' => true,
|
||||
'antivirus' => true,
|
||||
'$read' => ['role:all'],
|
||||
'$write' => ['role:all'],
|
||||
'search' => 'buckets Default',
|
||||
]));
|
||||
$this->createCollection('files', 'bucket_1');
|
||||
|
||||
/**
|
||||
* Rename folder on volumes.
|
||||
*/
|
||||
$path = "/storage/uploads/app-{$this->project->getId()}";
|
||||
|
||||
if (is_dir("{$path}/")) {
|
||||
mkdir("/storage/uploads/app-{$this->project->getId()}/default");
|
||||
|
||||
foreach (new \DirectoryIterator($path) as $fileinfo) {
|
||||
if ($fileinfo->isDir() && !$fileinfo->isDot() && $fileinfo->getFilename() !== 'default') {
|
||||
rename("{$path}/{$fileinfo->getFilename()}", "{$path}/default/{$fileinfo->getFilename()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'functions':
|
||||
try {
|
||||
/**
|
||||
* Rename tag to deployment
|
||||
*/
|
||||
$this->projectDB->renameAttribute($id, 'tag', 'deployment');
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'deployment' from {$id}: {$th->getMessage()}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deployments table if not exists.
|
||||
*/
|
||||
$this->createCollection('deployments');
|
||||
|
||||
/**
|
||||
* Create builds table if not exists.
|
||||
*/
|
||||
$this->createCollection('builds');
|
||||
|
||||
break;
|
||||
}
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates colletion from the config collection.
|
||||
*
|
||||
* @param string $id
|
||||
* @param string|null $name
|
||||
* @return void
|
||||
* @throws \Throwable
|
||||
*/
|
||||
protected function createCollection(string $id, string $name = null): void
|
||||
{
|
||||
$name ??= $id;
|
||||
|
||||
if (!$this->projectDB->exists(App::getEnv('_APP_DB_SCHEMA', 'appwrite'), $name)) {
|
||||
$attributes = [];
|
||||
$indexes = [];
|
||||
$collection = $this->collections[$id];
|
||||
|
||||
foreach ($collection['attributes'] as $attribute) {
|
||||
$attributes[] = new Document([
|
||||
'$id' => $attribute['$id'],
|
||||
'type' => $attribute['type'],
|
||||
'size' => $attribute['size'],
|
||||
'required' => $attribute['required'],
|
||||
'signed' => $attribute['signed'],
|
||||
'array' => $attribute['array'],
|
||||
'filters' => $attribute['filters'],
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($collection['indexes'] as $index) {
|
||||
$indexes[] = new Document([
|
||||
'$id' => $index['$id'],
|
||||
'type' => $index['type'],
|
||||
'attributes' => $index['attributes'],
|
||||
'lengths' => $index['lengths'],
|
||||
'orders' => $index['orders'],
|
||||
]);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->projectDB->createCollection($name, $attributes, $indexes);
|
||||
} catch (\Throwable $th) {
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrates permissions to dedicated table.
|
||||
*
|
||||
* @param \Utopia\Database\Document $document
|
||||
* @param string $internalId
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
* @throws \PDOException
|
||||
*/
|
||||
protected function migratePermissionsToDedicatedTable(string $collection, Document $document): void
|
||||
{
|
||||
$sql = "SELECT _read, _write FROM `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$collection}` WHERE _uid = {$this->pdo->quote($document->getid())}";
|
||||
$stmt = $this->pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
$permissions = $stmt->fetch();
|
||||
|
||||
$read = json_decode($permissions['_read'] ?? null) ?? [];
|
||||
$write = json_decode($permissions['_write'] ?? null) ?? [];
|
||||
|
||||
$permissions = [];
|
||||
foreach ($read as $permission) {
|
||||
$permissions[] = "('read', '{$permission}', '{$document->getId()}')";
|
||||
}
|
||||
|
||||
foreach ($write as $permission) {
|
||||
$permissions[] = "('write', '{$permission}', '{$document->getId()}')";
|
||||
}
|
||||
|
||||
if (!empty($permissions)) {
|
||||
$queryPermissions = "INSERT IGNORE INTO `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$collection}_perms` (_type, _permission, _document) VALUES " . implode(', ', $permissions);
|
||||
$stmtPermissions = $this->pdo->prepare($queryPermissions);
|
||||
$stmtPermissions->execute();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrates all user's database collections.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function migrateCustomCollections(): void
|
||||
{
|
||||
$nextCollection = null;
|
||||
|
||||
do {
|
||||
$documents = $this->projectDB->find('collections', limit: $this->limit, cursor: $nextCollection);
|
||||
$count = count($documents);
|
||||
|
||||
\Co\run(function (array $documents) {
|
||||
foreach ($documents as $document) {
|
||||
go(function (Document $collection) {
|
||||
$id = $collection->getId();
|
||||
$projectId = $this->project->getId();
|
||||
$internalId = $collection->getInternalId();
|
||||
|
||||
/**
|
||||
* Rename user's colletion table schema
|
||||
*/
|
||||
$this->pdo->prepare("ALTER TABLE IF EXISTS _project_{$projectId}_collection_{$id} RENAME TO _{$projectId}_collection_{$internalId}")->execute();
|
||||
$this->pdo->prepare("CREATE TABLE IF NOT EXISTS _{$projectId}_collection_{$internalId}_perms (
|
||||
`_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`_type` VARCHAR(12) NOT NULL,
|
||||
`_permission` VARCHAR(255) NOT NULL,
|
||||
`_document` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`_id`),
|
||||
UNIQUE INDEX `_index1` (`_type`,`_document`,`_permission`),
|
||||
INDEX `_index2` (`_permission`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;")->execute();
|
||||
|
||||
/**
|
||||
* Update metadata table.
|
||||
*/
|
||||
$this->pdo->prepare("UPDATE _{$projectId}__metadata
|
||||
SET
|
||||
_uid = 'collection_{$internalId}',
|
||||
name = 'collection_{$internalId}'
|
||||
WHERE _uid = 'collection_{$id}';
|
||||
")->execute();
|
||||
|
||||
|
||||
$nextDocument = null;
|
||||
|
||||
do {
|
||||
$documents = $this->projectDB->find('collection_' . $internalId, limit: $this->limit, cursor: $nextDocument);
|
||||
$count = count($documents);
|
||||
|
||||
foreach ($documents as $document) {
|
||||
go(function (Document $document, string $internalId) {
|
||||
$this->migratePermissionsToDedicatedTable("collection_{$internalId}", $document);
|
||||
}, $document, $internalId);
|
||||
}
|
||||
|
||||
if ($count !== $this->limit) {
|
||||
$nextDocument = null;
|
||||
} else {
|
||||
$nextDocument = end($documents);
|
||||
}
|
||||
} while (!is_null($nextDocument));
|
||||
|
||||
/**
|
||||
* Remove _read and _write columns
|
||||
*/
|
||||
$this->pdo->prepare("
|
||||
ALTER TABLE `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_collection_{$internalId}`
|
||||
DROP COLUMN _read,
|
||||
DROP COLUMN _write
|
||||
")->execute();
|
||||
}, $document);
|
||||
}
|
||||
}, $documents);
|
||||
|
||||
if ($count !== $this->limit) {
|
||||
$nextCollection = null;
|
||||
} else {
|
||||
$nextCollection = end($documents);
|
||||
}
|
||||
} while (!is_null($nextCollection));
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate all Permission to new System with dedicated Table.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
|
@ -125,6 +397,31 @@ class V12 extends Migration
|
|||
{
|
||||
foreach ($this->collections as $collection) {
|
||||
$id = $collection['$id'];
|
||||
|
||||
/**
|
||||
* Skip new tables that don't exists on old schema.
|
||||
*/
|
||||
if (in_array($id, ['buckets', 'deployments', 'builds'])) {
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* Check if permissions have already been migrated.
|
||||
*/
|
||||
try {
|
||||
$stmtCheck = $this->pdo->prepare("SHOW COLUMNS from `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$id}` LIKE '_read'");
|
||||
$stmtCheck->execute();
|
||||
|
||||
if (empty($stmtCheck->fetchAll())) {
|
||||
continue;
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
if ($th->getCode() === "42S02") {
|
||||
continue;
|
||||
}
|
||||
throw $th;
|
||||
}
|
||||
|
||||
|
||||
Console::log("- {$collection['$id']}");
|
||||
$nextDocument = null;
|
||||
|
||||
|
|
@ -135,29 +432,7 @@ class V12 extends Migration
|
|||
\Co\run(function (array $documents) {
|
||||
foreach ($documents as $document) {
|
||||
go(function (Document $document) {
|
||||
$sql = "SELECT _read, _write FROM `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$document->getCollection()}` WHERE _uid = {$this->pdo->quote($document->getid())}";
|
||||
$stmt = $this->pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
$permissions = $stmt->fetch();
|
||||
|
||||
$read = json_decode($permissions['_read'] ?? null) ?? [];
|
||||
$write = json_decode($permissions['_write'] ?? null) ?? [];
|
||||
|
||||
$permissions = [];
|
||||
foreach ($read as $permission) {
|
||||
$permissions[] = "('read', '{$permission}', '{$document->getId()}')";
|
||||
}
|
||||
|
||||
foreach ($write as $permission) {
|
||||
$permissions[] = "('write', '{$permission}', '{$document->getId()}')";
|
||||
}
|
||||
|
||||
if (!empty($permissions)) {
|
||||
$queryPermissions = "INSERT IGNORE INTO `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$document->getCollection()}_perms` (_type, _permission, _document) VALUES " . implode(', ', $permissions);
|
||||
$stmtPermissions = $this->pdo->prepare($queryPermissions);
|
||||
$stmtPermissions->execute();
|
||||
}
|
||||
$this->migratePermissionsToDedicatedTable($document->getCollection(), $document);
|
||||
}, $document);
|
||||
}
|
||||
}, $documents);
|
||||
|
|
@ -168,6 +443,15 @@ class V12 extends Migration
|
|||
$nextDocument = end($documents);
|
||||
}
|
||||
} while (!is_null($nextDocument));
|
||||
|
||||
/**
|
||||
* Remove _read and _write columns
|
||||
*/
|
||||
$this->pdo->prepare("
|
||||
ALTER TABLE `{$this->projectDB->getDefaultDatabase()}`.`{$this->projectDB->getNamespace()}_{$id}`
|
||||
DROP COLUMN _read,
|
||||
DROP COLUMN _write
|
||||
")->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -176,6 +460,12 @@ class V12 extends Migration
|
|||
usleep(100000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix run on each document
|
||||
*
|
||||
* @param \Utopia\Database\Document $document
|
||||
* @return \Utopia\Database\Document
|
||||
*/
|
||||
protected function fixDocument(Document $document)
|
||||
{
|
||||
switch ($document->getCollection()) {
|
||||
|
|
@ -205,6 +495,13 @@ class V12 extends Migration
|
|||
break;
|
||||
|
||||
case 'teams':
|
||||
/**
|
||||
* Rename sum to total
|
||||
*/
|
||||
if (empty($document->getAttribute('total'))) {
|
||||
$document->setAttribute('total', $document->getAttribute('sum'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate search string from Migration to 0.12.
|
||||
*/
|
||||
|
|
@ -215,6 +512,14 @@ class V12 extends Migration
|
|||
break;
|
||||
|
||||
case 'files':
|
||||
/**
|
||||
* Update File Path
|
||||
*/
|
||||
$path = "/storage/uploads/app-{$this->project->getId()}";
|
||||
$new = str_replace($path, "{$path}/default", $document->getAttribute('path'));
|
||||
$document
|
||||
->setAttribute('bucketId', 'default')
|
||||
->setAttribute('path', $new);
|
||||
/**
|
||||
* Populate search string from Migration to 0.12.
|
||||
*/
|
||||
|
|
@ -225,6 +530,8 @@ class V12 extends Migration
|
|||
break;
|
||||
|
||||
case 'functions':
|
||||
$document->setAttribute('deployment', null);
|
||||
|
||||
/**
|
||||
* Populate search string from Migration to 0.12.
|
||||
*/
|
||||
|
|
@ -234,16 +541,6 @@ class V12 extends Migration
|
|||
|
||||
break;
|
||||
|
||||
case 'tags':
|
||||
/**
|
||||
* Populate search string from Migration to 0.12.
|
||||
*/
|
||||
if (empty($document->getAttribute('search'))) {
|
||||
$document->setAttribute('search', $this->buildSearchAttribute(['$id', 'command'], $document));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'executions':
|
||||
/**
|
||||
* Populate search string from Migration to 0.12.
|
||||
|
|
@ -254,6 +551,16 @@ class V12 extends Migration
|
|||
|
||||
break;
|
||||
|
||||
case 'memberships':
|
||||
/**
|
||||
* Populate search string.
|
||||
*/
|
||||
if (empty($document->getAttribute('search'))) {
|
||||
$document->setAttribute('search', $this->buildSearchAttribute(['$id', 'userId'], $document));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'sessions':
|
||||
$document
|
||||
->setAttribute('providerRefreshToken', '')
|
||||
|
|
|
|||
Loading…
Reference in a new issue