@@ -3352,7 +3352,7 @@ class TAlterBackupCollectionNode
33523352 , Params(params)
33533353 {}
33543354
3355- virtual INode::TPtr FillOptions (TContext&, INode::TPtr options) const final {
3355+ virtual INode::TPtr FillOptions (TContext& ctx , INode::TPtr options) const final {
33563356 options->Add (Q (Y (Q (" mode" ), Q (" alter" ))));
33573357
33583358 auto settings = Y ();
@@ -3363,19 +3363,23 @@ class TAlterBackupCollectionNode
33633363
33643364 auto resetSettings = Y ();
33653365 for (auto & key : Params.SettingsToReset ) {
3366- resetSettings->Add (Q ( BuildQuotedAtom (Pos, key) ));
3366+ resetSettings->Add (BuildQuotedAtom (Pos, key));
33673367 }
33683368 options->Add (Q (Y (Q (" resetSettings" ), Q (resetSettings))));
33693369
3370- // auto entries = Y();
3371- // if (Params.Database) {
3372- // entries->Add(Q(Y(Q(Y(Q("type"), Q("database"))))));
3373- // }
3374- // for (auto& table : Params.Tables) {
3375- // auto path = ctx.GetPrefixedPath(ServiceId, Cluster, table);
3376- // entries->Add(Q(Y(Q(Y(Q("type"), Q("table"))), Q(Y(Q("path"), path)))));
3377- // }
3378- // options->Add(Q(Y(Q("entries"), Q(entries))));
3370+ auto entries = Y ();
3371+ if (Params.Database != TAlterBackupCollectionParameters::EDatabase::Unchanged) {
3372+ entries->Add (Q (Y (Q (Y (Q (" type" ), Q (" database" ))), Q (Y (Q (" action" ), Q (Params.Database == TAlterBackupCollectionParameters::EDatabase::Add ? " add" : " drop" ))))));
3373+ }
3374+ for (auto & table : Params.TablesToAdd ) {
3375+ auto path = ctx.GetPrefixedPath (ServiceId, Cluster, table);
3376+ entries->Add (Q (Y (Q (Y (Q (" type" ), Q (" table" ))), Q (Y (Q (" path" ), path)), Q (Y (Q (" action" ), Q (" add" ))))));
3377+ }
3378+ for (auto & table : Params.TablesToDrop ) {
3379+ auto path = ctx.GetPrefixedPath (ServiceId, Cluster, table);
3380+ entries->Add (Q (Y (Q (Y (Q (" type" ), Q (" table" ))), Q (Y (Q (" path" ), path)), Q (Y (Q (" action" ), Q (" drop" ))))));
3381+ }
3382+ options->Add (Q (Y (Q (" alterEntries" ), Q (entries))));
33793383
33803384 return options;
33813385 }
0 commit comments