1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13: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:
Steven Nguyen 2023-08-16 16:35:18 -07:00
parent e8f5229756
commit ccd8c86e88
No known key found for this signature in database

View file

@ -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());
// }
}
/**