mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Skip updating _uid attribute and _permission index
These updates make use of the PDO to manually execute a SQL statement, but the PDO is not available in the new migration platform task. So that we can move forward with the release, we will skip these updates and then figure it out in a subsequent release.
This commit is contained in:
@@ -516,29 +516,32 @@ class V19 extends Migration
|
||||
|
||||
protected function alterPermissionIndex($collectionName): void
|
||||
{
|
||||
try {
|
||||
$table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms`";
|
||||
$this->pdo->prepare("
|
||||
ALTER TABLE {$table}
|
||||
DROP INDEX `_permission`,
|
||||
ADD INDEX `_permission` (`_permission`, `_type`, `_document`);
|
||||
")->execute();
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning($th->getMessage());
|
||||
}
|
||||
// try {
|
||||
// // $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms`";
|
||||
// // $this->pdo->prepare("
|
||||
// // ALTER TABLE {$table}
|
||||
// // DROP INDEX `_permission`,
|
||||
// // ADD INDEX `_permission` (`_permission`, `_type`, `_document`);
|
||||
// // ")->execute();
|
||||
// $this->projectDB->deleteIndex($collectionName, '_permission', ['_permission', '_type', '_document']);
|
||||
// $this->projectDB->createIndex($collectionName, '_permission', Database::INDEX_KEY, ['_permission', '_type', '_document'])
|
||||
// } catch (\Throwable $th) {
|
||||
// Console::warning($th->getMessage());
|
||||
// }
|
||||
}
|
||||
|
||||
protected function alterUidType($collectionName): void
|
||||
{
|
||||
try {
|
||||
$table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}`";
|
||||
$this->pdo->prepare("
|
||||
ALTER TABLE {$table}
|
||||
CHANGE COLUMN `_uid` `_uid` VARCHAR(255) NOT NULL ;
|
||||
")->execute();
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning($th->getMessage());
|
||||
}
|
||||
// try {
|
||||
// // $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}`";
|
||||
// // $this->pdo->prepare("
|
||||
// // ALTER TABLE {$table}
|
||||
// // CHANGE COLUMN `_uid` `_uid` VARCHAR(255) NOT NULL ;
|
||||
// // ")->execute();
|
||||
// $this->projectDB->updateAttribute($collectionName, '_uid', type: 'string', size: 255, required: true);
|
||||
// } catch (\Throwable $th) {
|
||||
// Console::warning($th->getMessage());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user