diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index cfba5d0677..7030396eaa 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -336,8 +336,12 @@ class Migrations extends Action //$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; //$endpoint = $protocol . '://' . $platform['apiHostname'] . '/v1'; - $endpoint = 'http://localhost/v1'; - $endpoint = 'http://appwrite/v1'; + $host = System::getEnv('_APP_MIGRATION_HOST'); + if (empty($host)) { + throw new \Exception('_APP_MIGRATION_HOST is not set'); + } + + $endpoint = 'http://'.$host.'/v1'; try { $credentials = $migration->getAttribute('credentials', []);