Update constants

This commit is contained in:
Bradley Schofield
2023-07-21 11:37:40 +01:00
parent cff7ba2bff
commit 7eb286ccd4
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -204,7 +204,7 @@ App::post('/v1/migrations/appwrite')
'status' => 'pending',
'stage' => 'init',
'source' => json_encode([
'type' => 'appwrite',
'type' => Appwrite::getName(),
'endpoint' => $endpoint,
'projectId' => $projectId,
'apiKey' => $apiKey,
@@ -288,7 +288,7 @@ App::post('/v1/migrations/firebase')
'status' => 'pending',
'stage' => 'init',
'source' => json_encode([
'type' => 'firebase',
'type' => Firebase::getName(),
'serviceAccount' => $serviceAccount,
]),
'resources' => $resources,
@@ -376,7 +376,7 @@ App::post('/v1/migrations/supabase')
'status' => 'pending',
'stage' => 'init',
'source' => json_encode([
'type' => 'supabase',
'type' => Supabase::getName(),,
'endpoint' => $endpoint,
'apiKey' => $apiKey,
'databaseHost' => $databaseHost,
@@ -473,7 +473,7 @@ App::post('/v1/migrations/nhost')
'status' => 'pending',
'stage' => 'init',
'source' => json_encode([
'type' => 'nhost',
'type' => NHost::getName(),,
'subdomain' => $subdomain,
'region' => $region,
'adminSecret' => $adminSecret,
+4 -4
View File
@@ -78,12 +78,12 @@ class MigrationsV1 extends Worker
protected function processSource(array $source): Source
{
switch ($source['type']) {
case 'firebase':
case Firebase::getName():
return new Firebase(
json_decode($source['serviceAccount'], true),
);
break;
case 'supabase':
case Supabase::getName():
return new Supabase(
$source['endpoint'],
$source['apiKey'],
@@ -94,7 +94,7 @@ class MigrationsV1 extends Worker
$source['port'],
);
break;
case 'nhost':
case NHost::getName():
return new NHost(
$source['subdomain'],
$source['region'],
@@ -105,7 +105,7 @@ class MigrationsV1 extends Worker
$source['port'],
);
break;
case 'appwrite':
case Appwrite::getName():
return new Appwrite($source['projectId'], str_starts_with($source['endpoint'], 'http://localhost/v1') ? 'http://appwrite/v1' : $source['endpoint'], $source['apiKey']);
break;
default: