File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
ydb/core/fq/libs/compute/ydb/control_plane Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -289,8 +289,13 @@ class TCreateDatabaseRequestActor : public NActors::TActorBootstrapped<TCreateDa
289289 void FillRequest (TEvYdbCompute::TEvCreateDatabaseRequest::TPtr& ev, const NConfig::TComputeDatabaseConfig& config) {
290290 NYdb::NFq::TScope scope (ev.Get ()->Get ()->Scope );
291291 ev.Get ()->Get ()->BasePath = config.GetControlPlaneConnection ().GetDatabase ();
292- const TString databaseName = TStringBuilder{} << Config.GetYdb ().GetControlPlane ().GetDatabasePrefix () << (config.GetId () ? config.GetId () + " _" : TString{}) << scope.ParseFolder ();
293- ev.Get ()->Get ()->Path = config.GetTenant () ? config.GetTenant () + " /" + databaseName: databaseName;
292+
293+ const auto & tenant = config.GetTenant ();
294+ if (const auto & previousPath = Result.connection ().database (); previousPath && (!tenant || previousPath.StartsWith (tenant + " /" ))) {
295+ ev.Get ()->Get ()->Path = previousPath;
296+ } else {
297+ ev.Get ()->Get ()->Path = TStringBuilder () << (tenant ? tenant + " /" : TString{}) << Config.GetYdb ().GetControlPlane ().GetDatabasePrefix () << (config.GetId () ? config.GetId () + " _" : TString{}) << scope.ParseFolder ();
298+ }
294299 }
295300
296301private:
You can’t perform that action at this time.
0 commit comments