QA test result Scenario I A) Deleting a single Campaign Before Fix mysql> select * from admaxCampaigns where accountID=567; +-----+------------+--------------------------------------------------------+-----------+--------------------+--------+ | id | identifier | description | accountID | campaignGroupingID | status | +-----+------------+--------------------------------------------------------+-----------+--------------------+--------+ | 991 | 3176 | 9dd4bf1d-ff29-4c8b-aa2d-4224d1410b4e_50370_200047_3176 | 567 | 0 | Paused | +-----+------------+--------------------------------------------------------+-----------+--------------------+--------+ 1 row in set (0.00 sec) mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=567); +------+-----------------+------------+---------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +------+-----------------+------------+---------+--------+ | 1795 | 991 | 2013-11-26 | NULL | 500 | +------+-----------------+------------+---------+--------+ 1 row in set (0.01 sec) Add new campaign and delete the original mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=567); +------+-----------------+------------+------------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +------+-----------------+------------+------------+--------+ | 1795 | 991 | 2013-11-26 | 2013-11-26 | 250 | | 1796 | 992 | 2013-11-26 | NULL | 500 | +------+-----------------+------------+------------+--------+ 2 rows in set (0.01 sec) Delete new campaign and Add the original mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=567); +------+-----------------+------------+------------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +------+-----------------+------------+------------+--------+ | 1795 | 991 | 2013-11-26 | 2013-11-26 | 250 | | 1796 | 992 | 2013-11-26 | 2013-11-26 | 250 | | 1801 | 993 | 2013-11-26 | NULL | 500 | +------+-----------------+------------+------------+--------+ 3 rows in set (0.01 sec) ========================================================================================================================== After applying fix on QA 4 1)Create order mysql> select * from admaxCampaigns where description like '%d39e1dcb-c217-49ce-82e7-6cf23d2e01a0%'; +-----+------------+---------------------------------------------------+-----------+--------------------+--------+ | id | identifier | description | accountID | campaignGroupingID | status | +-----+------------+---------------------------------------------------+-----------+--------------------+--------+ | 284 | 771 | d39e1dcb-c217-49ce-82e7-6cf23d2e01a0_11264_33_771 | 174 | 0 | Active | +-----+------------+---------------------------------------------------+-----------+--------------------+--------+ 1 row in set (0.00 sec) mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=174); +-----+-----------------+------------+---------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+---------+--------+ | 361 | 284 | 2013-11-26 | NULL | 100 | +-----+-----------------+------------+---------+--------+ 1 row in set (0.00 sec) 2) Add a new campaign to the existing mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=174); +-----+-----------------+------------+---------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+---------+--------+ | 361 | 284 | 2013-11-26 | NULL | 50 | | 362 | 285 | 2013-11-26 | NULL | 50 | +-----+-----------------+------------+---------+--------+ 2 rows in set (0.00 sec) 3) Delete the newly added campaign and add the original campaign again mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=174); +-----+-----------------+------------+------------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+------------+--------+ | 361 | 284 | 2013-11-26 | 2013-11-26 | 50 | | 362 | 285 | 2013-11-26 | 2013-11-26 | 50 | | 365 | 285 | 2013-11-27 | NULL | 100 | +-----+-----------------+------------+------------+--------+ 3 rows in set (0.00 sec) mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=174); +-----+-----------------+------------+------------+---------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+------------+---------+ | 361 | 284 | 2013-11-26 | 2013-11-26 | 33.3333 | | 362 | 285 | 2013-11-26 | 2013-11-26 | 33.3333 | | 368 | 286 | 2013-11-26 | 2013-11-26 | 33.3333 | | 371 | 286 | 2013-11-27 | NULL | 100 | +-----+-----------------+------------+------------+---------+ 4 rows in set (0.00 sec) ==================================================================================================================================== Scenario II : Multiple Campaigns addition and deletion 1) Add 2 campaigns mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=175); +-----+-----------------+------------+---------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+---------+--------+ | 373 | 287 | 2013-11-26 | NULL | 50 | | 374 | 288 | 2013-11-26 | NULL | 50 | +-----+-----------------+------------+---------+--------+ 2 rows in set (0.00 sec) 2) Add 2 new campaigns and delete 2 existing mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=175); +-----+-----------------+------------+------------+--------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+------------+--------+ | 373 | 287 | 2013-11-26 | 2013-11-26 | 25 | | 374 | 288 | 2013-11-26 | 2013-11-26 | 25 | | 376 | 289 | 2013-11-26 | 2013-11-26 | 25 | | 377 | 290 | 2013-11-26 | 2013-11-26 | 25 | | 380 | 289 | 2013-11-27 | NULL | 50 | | 382 | 290 | 2013-11-27 | NULL | 50 | +-----+-----------------+------------+------------+--------+ 6 rows in set (0.00 sec) 3) Delete newly added and Readd the original campaigns mysql> select * from admaxNominalMonthlyBudgets where admaxCampaignID in (select id from admaxCampaigns where accountID=175); +-----+-----------------+------------+------------+---------+ | id | admaxCampaignID | startDate | endDate | budget | +-----+-----------------+------------+------------+---------+ | 373 | 287 | 2013-11-26 | 2013-11-26 | 16.6667 | | 374 | 288 | 2013-11-26 | 2013-11-26 | 16.6667 | | 376 | 289 | 2013-11-26 | 2013-11-26 | 16.6667 | | 377 | 290 | 2013-11-26 | 2013-11-26 | 16.6667 | | 387 | 291 | 2013-11-26 | 2013-11-26 | 16.6667 | | 392 | 291 | 2013-11-27 | NULL | 50 | | 395 | 292 | 2013-11-26 | 2013-11-26 | 16.6667 | | 401 | 292 | 2013-11-27 | NULL | 50 | +-----+-----------------+------------+------------+---------+ 8 rows in set (0.00 sec) ====================================================================================================================================