mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
fix: migration team memberships and permissions
This commit is contained in:
parent
3730e33b0c
commit
cf3136e51c
1 changed files with 14 additions and 2 deletions
|
|
@ -78,8 +78,7 @@ class V11 extends Migration
|
||||||
try {
|
try {
|
||||||
$project = $this->dbConsole->getDocument(collection: 'projects', id: $oldProject->getId());
|
$project = $this->dbConsole->getDocument(collection: 'projects', id: $oldProject->getId());
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
var_dump($th->getTraceAsString());
|
Console::error($th->getTraceAsString());
|
||||||
var_dump($th);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -588,6 +587,19 @@ class V11 extends Migration
|
||||||
$write = $document->getWrite();
|
$write = $document->getWrite();
|
||||||
$document->setAttribute('$write', str_replace('user:{self}', "user:{$document->getId()}", $write));
|
$document->setAttribute('$write', str_replace('user:{self}', "user:{$document->getId()}", $write));
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OldDatabase::SYSTEM_COLLECTION_TEAMS:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace team:{self} with team:TEAM_ID
|
||||||
|
*/
|
||||||
|
$read = $document->getWrite();
|
||||||
|
$write = $document->getWrite();
|
||||||
|
|
||||||
|
$document->setAttribute('$read', str_replace('team:{self}', "team:{$document->getId()}", $read));
|
||||||
|
$document->setAttribute('$write', str_replace('team:{self}', "team:{$document->getId()}", $write));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case OldDatabase::SYSTEM_COLLECTION_FILES:
|
case OldDatabase::SYSTEM_COLLECTION_FILES:
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue