@@ -113,14 +113,14 @@ end_per_testcase(CaseName, Config) ->
113113% %% ==================================================================
114114
115115migrate_pubsub_nodes (_Config ) ->
116- Nidx = create_migration_node (),
116+ _ = create_migration_node (),
117117 {ok , _ } = ? RPC_MIGRATE (<<" pubsub_nodes" >>),
118118 SqlData = #{table => <<" pubsub_nodes" >>, where => <<" name='" , ? NODE_NAME /binary , " '" >>},
119- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
120- {selected , [{Nidx }]} ->
119+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" name " >>}) of
120+ {selected , [{? NODE_NAME }]} ->
121121 {updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
122122 _ = clear_tables (),
123- ct :comment (" Migration of 'pubsub_nodes' is successful for Nidx : ~p " , [Nidx ]);
123+ ct :comment (" Migration of 'pubsub_nodes' is successful for 'name' : ~p " , [? NODE_NAME ]);
124124 Any ->
125125 ct :fail (" Unexpected result of 'pubsub_nodes' migration ~p~n " , [Any ])
126126 end .
@@ -133,12 +133,12 @@ migrate_pubsub_subscriptions(_Config) ->
133133 Nidx = create_migration_node (),
134134 ok = mongoose_helper :successful_rpc (mod_pubsub_db_mnesia , transaction , [#{name => add_subscription , args => [Nidx , ? JID , 'subscribed' , <<" 0000-0000-0000000" >>, []]}]),
135135 {ok , _ } = ? RPC_MIGRATE (<<" pubsub_subscriptions" >>),
136- SqlData = #{table => <<" pubsub_subscriptions" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
137- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
138- {selected , [{Nidx }]} ->
136+ SqlData = #{table => <<" pubsub_subscriptions" >>, where => <<" luser=' " , ? USERNAME /binary , " ' " >>},
137+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" luser " >>}) of
138+ {selected , [{? USERNAME }]} ->
139139 {updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
140140 _ = clear_tables (),
141- ct :comment (" Migration of 'pubsub_subscriptions' is successful for Nidx : ~p " , [Nidx ]);
141+ ct :comment (" Migration of 'pubsub_subscriptions' is successful for 'luser' : ~p " , [? USERNAME ]);
142142 Any ->
143143 ct :fail (" Unexpected result of 'pubsub_subscriptions' migration ~p~n " , [Any ])
144144 end .
@@ -148,14 +148,14 @@ migrate_pubsub_subscriptions(_Config) ->
148148% %% ==================================================================
149149
150150migrate_pubsub_affiliations (_Config ) ->
151- Nidx = create_migration_node (),
151+ _ = create_migration_node (),
152152 {ok , _ } = ? RPC_MIGRATE (<<" pubsub_affiliations" >>),
153- SqlData = #{table => <<" pubsub_affiliations" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
154- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
155- {selected , [{Nidx }]} ->
153+ SqlData = #{table => <<" pubsub_affiliations" >>, where => <<" luser=' " , ? USERNAME /binary , " ' " >>},
154+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" luser " >>}) of
155+ {selected , [{? USERNAME }]} ->
156156 {updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
157157 _ = clear_tables (),
158- ct :comment (" Migration of 'pubsub_affiliations' is successful for Nidx : ~p " , [Nidx ]);
158+ ct :comment (" Migration of 'pubsub_affiliations' is successful for 'pubsub_affiliations' : ~p " , [? USERNAME ]);
159159 Any ->
160160 ct :fail (" Unexpected result of 'pubsub_affiliations' migration ~p~n " , [Any ])
161161 end .
@@ -168,12 +168,12 @@ migrate_pubsub_items(_Config) ->
168168 Nidx = create_migration_node (),
169169 ok = mongoose_helper :successful_rpc (mod_pubsub_db_mnesia , transaction , [#{name => add_item , args => [Nidx , ? JID , ? BASE_ITEM (Nidx )]}]),
170170 {ok , _ } = ? RPC_MIGRATE (<<" pubsub_items" >>),
171- SqlData = #{table => <<" pubsub_items" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
172- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
173- {selected , [{Nidx }]} ->
171+ SqlData = #{table => <<" pubsub_items" >>, where => <<" created_luser=' " , ? USERNAME /binary , " ' " >>},
172+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" created_luser " >>}) of
173+ {selected , [{? USERNAME }]} ->
174174 {updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
175175 _ = clear_tables (),
176- ct :comment (" Migration of 'pubsub_items' is successful for Nidx : ~p " , [Nidx ]);
176+ ct :comment (" Migration of 'pubsub_items' is successful for 'created_luser' : ~p " , [? USERNAME ]);
177177 Any ->
178178 ct :fail (" Unexpected result of 'pubsub_items' migration ~p~n " , [Any ])
179179 end .
@@ -216,7 +216,7 @@ migrate_vcard_search(_Config) ->
216216% %% Test case for migrate vcard
217217% %% ==================================================================
218218
219- migrate_vcard (Config ) ->
219+ migrate_vcard (_Config ) ->
220220 ok = set_vcard (),
221221 {ok , _ } = ? RPC_MIGRATE (<<" vcard" >>),
222222 SqlData = #{table => <<" vcard" >>, where => <<" username='" , ? USERNAME /binary , " '" >>},
@@ -233,7 +233,7 @@ migrate_vcard(Config) ->
233233% %% Test case for migrate event_pusher_push_subscription
234234% %% ==================================================================
235235
236- migrate_event_pusher_push_subscription (Config ) ->
236+ migrate_event_pusher_push_subscription (_Config ) ->
237237 PubsubNode = <<" migration_pub_sub_node" >>,
238238 ok = mongoose_helper :successful_rpc (mod_event_pusher_push_mnesia , enable , [? JID , ? JID , PubsubNode , [{<<" name" >>, <<" value" >>}]]),
239239 {ok , _ } = ? RPC_MIGRATE (<<" event_pusher_push_subscription" >>),
@@ -251,63 +251,63 @@ migrate_event_pusher_push_subscription(Config) ->
251251% %% Test case for migrate rosterusers @TODO
252252% %% ==================================================================
253253
254- migrate_rosterusers (Config ) ->
254+ migrate_rosterusers (_Config ) ->
255255 ? RPC_MIGRATE (<<" rosterusers" >>),
256256 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
257257
258258% %% ==================================================================
259259% %% Test case for migrate roster_version @TODO
260260% %% ==================================================================
261261
262- migrate_roster_version (Config ) ->
262+ migrate_roster_version (_Config ) ->
263263 ? RPC_MIGRATE (<<" roster_version" >>),
264264 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
265265
266266% %% ==================================================================
267267% %% Test case for migrate rostergroups @TODO
268268% %% ==================================================================
269269
270- migrate_rostergroups (Config ) ->
270+ migrate_rostergroups (_Config ) ->
271271 ? RPC_MIGRATE (<<" rostergroups" >>),
272272 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
273273
274274% %% ==================================================================
275275% %% Test case for migrate last @TODO
276276% %% ==================================================================
277277
278- migrate_last (Config ) ->
278+ migrate_last (_Config ) ->
279279 ? RPC_MIGRATE (<<" last" >>),
280280 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
281281
282282% %% ==================================================================
283283% %% Test case for migrate private_storage @TODO
284284% %% ==================================================================
285285
286- migrate_private_storage (Config ) ->
286+ migrate_private_storage (_Config ) ->
287287 ? RPC_MIGRATE (<<" private_storage" >>),
288288 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
289289
290290% %% ==================================================================
291291% %% Test case for migrate offline_message @TODO
292292% %% ==================================================================
293293
294- migrate_offline_message (Config ) ->
294+ migrate_offline_message (_Config ) ->
295295 ? RPC_MIGRATE (<<" offline_message" >>),
296296 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
297297
298298% %% ==================================================================
299299% %% Test case for migrate muc_light_rooms @TODO
300300% %% ==================================================================
301301
302- migrate_muc_light_rooms (Config ) ->
302+ migrate_muc_light_rooms (_Config ) ->
303303 ? RPC_MIGRATE (<<" muc_light_rooms" >>),
304304 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
305305
306306% %% ==================================================================
307307% %% Test case for migrate all @TODO
308308% %% ==================================================================
309309
310- migrate_all (Config ) ->
310+ migrate_all (_Config ) ->
311311 ? RPC_MIGRATE (<<" all" >>),
312312 ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
313313
@@ -331,7 +331,7 @@ slow_rpc(M, F, A) ->
331331
332332sql_to_rdbms (#{act := Act , column := Column , table := Table , where := Where }) ->
333333 SelectQuery = <<Act /binary , " " , Column /binary , " FROM " , Table /binary , " WHERE " , Where /binary >>,
334- SelectResult = sql_query (SelectQuery ).
334+ sql_query (SelectQuery ).
335335
336336clear_tables () ->
337337 Tables = [pubsub_state , pubsub_item , pubsub_node ,
0 commit comments