mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
ID updates
This commit is contained in:
@@ -9,6 +9,7 @@ use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
use Exception;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\ID;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
|
||||
abstract class Migration
|
||||
@@ -62,15 +63,15 @@ abstract class Migration
|
||||
Authorization::setDefaultStatus(false);
|
||||
$this->collections = array_merge([
|
||||
'_metadata' => [
|
||||
'$id' => '_metadata',
|
||||
'$id' => ID::custom('_metadata'),
|
||||
'$collection' => Database::METADATA
|
||||
],
|
||||
'audit' => [
|
||||
'$id' => 'audit',
|
||||
'$id' => ID::custom('audit'),
|
||||
'$collection' => Database::METADATA
|
||||
],
|
||||
'abuse' => [
|
||||
'$id' => 'abuse',
|
||||
'$id' => ID::custom('abuse'),
|
||||
'$collection' => Database::METADATA
|
||||
]
|
||||
], Config::getParam('collections', []));
|
||||
|
||||
@@ -158,8 +158,8 @@ class V12 extends Migration
|
||||
|
||||
if (!$this->projectDB->findOne('buckets', [new Query('$id', Query::TYPE_EQUAL, ['default'])])) {
|
||||
$this->projectDB->createDocument('buckets', new Document([
|
||||
'$id' => 'default',
|
||||
'$collection' => 'buckets',
|
||||
'$id' => ID::custom('default'),
|
||||
'$collection' => ID::custom('buckets'),
|
||||
'dateCreated' => \time(),
|
||||
'dateUpdated' => \time(),
|
||||
'name' => 'Default',
|
||||
|
||||
@@ -67,7 +67,7 @@ class V14 extends Migration
|
||||
|
||||
try {
|
||||
$this->projectDB->createDocument('databases', new Document([
|
||||
'$id' => 'default',
|
||||
'$id' => ID::custom('default'),
|
||||
'name' => 'Default',
|
||||
'search' => 'default Default'
|
||||
]));
|
||||
|
||||
@@ -278,7 +278,7 @@ class V11 extends Filter
|
||||
$content['rules'] = \array_map(function ($attribute) use ($content) {
|
||||
return [
|
||||
'$id' => $attribute['key'],
|
||||
'$collection' => $content['$id'],
|
||||
'$collection' => ID::custom($content['$id']),
|
||||
'type' => $attribute['type'],
|
||||
'key' => $attribute['key'],
|
||||
'label' => $attribute['key'],
|
||||
|
||||
@@ -32,7 +32,7 @@ class Bucket extends Model
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File permissions.',
|
||||
'default' => [],
|
||||
'example' => [Permission::read(Role::any())],
|
||||
'example' => ['read("any")'],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('fileSecurity', [
|
||||
|
||||
@@ -32,7 +32,7 @@ class Collection extends Model
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection permissions.',
|
||||
'default' => '',
|
||||
'example' => Permission::read(Role::any()),
|
||||
'example' => ['read("any")'],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('databaseId', [
|
||||
|
||||
@@ -56,9 +56,9 @@ class Document extends Any
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Document write permissions.',
|
||||
'description' => 'Document permissions.',
|
||||
'default' => '',
|
||||
'example' => Permission::read(Role::user('608f9da25e7e1')),
|
||||
'example' => ['read("any")'],
|
||||
'array' => true,
|
||||
])
|
||||
;
|
||||
|
||||
@@ -28,11 +28,11 @@ class Execution extends Model
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
->addRule('$roles', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Execution permissions.',
|
||||
'description' => 'Execution roles.',
|
||||
'default' => '',
|
||||
'example' => 'any',
|
||||
'example' => ['any'],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('functionId', [
|
||||
|
||||
@@ -38,7 +38,7 @@ class File extends Model
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File permissions.',
|
||||
'default' => [],
|
||||
'example' => Permission::read(Role::any()),
|
||||
'example' => ['read("any")'],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('name', [
|
||||
|
||||
Reference in New Issue
Block a user