MT#19035 Don't save billing_fee_raw data

We will not need to insert lower id from billing_fees_raw
as we have it already in billing_fees

Change-Id: I03dbe5fcf02a63d1a66f4106afe86d8f8b261019
changes/38/5638/5
Irina Peshinskaya 10 years ago
parent 418c6ee246
commit fcf1f7c947

@ -250,7 +250,17 @@ sub insert_unique_billing_fees{
my(%params) = @_;
my($c,$schema,$profile,$fees,$return_created) = @params{qw/c schema profile fees return_created/};
$return_created //= 0;
#while we use lower id we don't need insert records from billing_fees, they are already contain in billing_fees with lower id
$profile->billing_fees_raw->delete();
$schema->storage->dbh_do(sub{
my ($storage, $dbh) = @_;
(my ($auto_increment)) = $dbh->selectrow_array('select `AUTO_INCREMENT` from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = "billing" AND TABLE_NAME = "billing_fees"');
$dbh->do('alter table billing.billing_fees_raw auto_increment='.$auto_increment);
});
my $created_fees_raw = $profile->billing_fees_raw->populate($fees);
$schema->storage->dbh_do(sub{
my ($storage, $dbh) = @_;
$c->log->debug('call billing.fill_billing_fees('.$profile->id.')');

@ -116,6 +116,9 @@ $test_machine->check_bundle();
{
my($res,$item_put,$req) = $test_machine->check_get2put();
$test_machine->check_embedded($item_put->{content});
#check create after edit
#19035
$test_machine->check_create_correct( 1, sub{ $_[0]->{destination} .= $_[1]->{i} + 3 ; } );
}
{
my($res,$mod_fee) = $test_machine->check_patch_correct( [ { op => 'replace', path => '/direction', value => 'in' } ] );
@ -139,6 +142,7 @@ $test_machine->check_bundle();
}
$test_machine->clear_test_data_all();
$fake_data->created({});
{
my $uri = $test_machine->normalize_uri('/api/billingzones/'.$test_machine->DATA_ITEM->{billing_zone_id});

Loading…
Cancel
Save