fix: migrations fix and update changelog
This commit is contained in:
parent
90eed32311
commit
5cfabc7a12
18
CHANGES.md
18
CHANGES.md
|
@ -4,7 +4,23 @@
|
|||
|
||||
## Changes
|
||||
|
||||
- Make installation confirmation case insensitive [#6097](https://github.com/appwrite/appwrite/pull/6097)
|
||||
* Fix create phone session abuse key by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6134
|
||||
* Fix CLI backwards compatibility by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6125
|
||||
* Override forEachDocument() to skip the cache collection by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6144
|
||||
* Fix Not Found error when deploying function from git by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6133
|
||||
* Add required params for scheduled functions by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6148
|
||||
* Update the error message for router_domain_not_configured by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6145
|
||||
* Fix _APP_EXECUTOR_HOST for upgrades by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6141
|
||||
* Change executor hostname back to appwrite-executor by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6160
|
||||
* Fix create execution request filter from previous SDK version by @stnguyen90 in https://github.com/appwrite/appwrite/pull/6146
|
||||
* Fix: AI Assistant by @Meldiron in https://github.com/appwrite/appwrite/pull/6153
|
||||
* Make URL optional for Create Membership API and Serverside Requests by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/6157
|
||||
* Fix: v2 functions by @Meldiron in https://github.com/appwrite/appwrite/pull/6142
|
||||
* Fix migrations worker by @abnegate in https://github.com/appwrite/appwrite/pull/6116
|
||||
* Fix: Global variables by @Meldiron in https://github.com/appwrite/appwrite/pull/6150
|
||||
* Fix webhook secret validation and executor path validation by @vermakhushboo in https://github.com/appwrite/appwrite/pull/6162
|
||||
* Fix: Untrusted custom domains + auto-ssl by @Meldiron in https://github.com/appwrite/appwrite/pull/6155
|
||||
* Update composer.lock by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/6161
|
||||
|
||||
# Version 1.4.1
|
||||
|
||||
|
|
|
@ -50,35 +50,37 @@ class V19 extends Migration
|
|||
|
||||
protected function migrateDomains(): void
|
||||
{
|
||||
foreach ($this->documentsIterator('domains') as $domain) {
|
||||
$status = 'created';
|
||||
if ($domain->getAttribute('verification', false)) {
|
||||
$status = 'verified';
|
||||
}
|
||||
|
||||
$projectId = $domain->getAttribute('projectId');
|
||||
$projectInternalId = $domain->getAttribute('projectInternalId');
|
||||
|
||||
if (empty($projectId) || empty($projectInternalId)) {
|
||||
Console::warning("Error migrating domain {$domain->getAttribute('domain')}: Missing projectId or projectInternalId");
|
||||
continue;
|
||||
}
|
||||
|
||||
$ruleDocument = new Document([
|
||||
'projectId' => $domain->getAttribute('projectId'),
|
||||
'projectInternalId' => $domain->getAttribute('projectInternalId'),
|
||||
'domain' => $domain->getAttribute('domain'),
|
||||
'resourceType' => 'api',
|
||||
'resourceInternalId' => '',
|
||||
'resourceId' => '',
|
||||
'status' => $status,
|
||||
'certificateId' => $domain->getAttribute('certificateId'),
|
||||
]);
|
||||
|
||||
try {
|
||||
$this->consoleDB->createDocument('rules', $ruleDocument);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("Error migrating domain {$domain->getAttribute('domain')}: {$th->getMessage()}");
|
||||
if ($this->consoleDB->exists($this->consoleDB->getDefaultDatabase(), 'domains')) {
|
||||
foreach ($this->documentsIterator('domains') as $domain) {
|
||||
$status = 'created';
|
||||
if ($domain->getAttribute('verification', false)) {
|
||||
$status = 'verified';
|
||||
}
|
||||
|
||||
$projectId = $domain->getAttribute('projectId');
|
||||
$projectInternalId = $domain->getAttribute('projectInternalId');
|
||||
|
||||
if (empty($projectId) || empty($projectInternalId)) {
|
||||
Console::warning("Error migrating domain {$domain->getAttribute('domain')}: Missing projectId or projectInternalId");
|
||||
continue;
|
||||
}
|
||||
|
||||
$ruleDocument = new Document([
|
||||
'projectId' => $domain->getAttribute('projectId'),
|
||||
'projectInternalId' => $domain->getAttribute('projectInternalId'),
|
||||
'domain' => $domain->getAttribute('domain'),
|
||||
'resourceType' => 'api',
|
||||
'resourceInternalId' => '',
|
||||
'resourceId' => '',
|
||||
'status' => $status,
|
||||
'certificateId' => $domain->getAttribute('certificateId'),
|
||||
]);
|
||||
|
||||
try {
|
||||
$this->consoleDB->createDocument('rules', $ruleDocument);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("Error migrating domain {$domain->getAttribute('domain')}: {$th->getMessage()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue