Correct typeId.

This commit is contained in:
Bradley M. Kuhn 2015-12-06 15:43:07 -08:00
parent 21d555d0cc
commit 9732457d7e

View file

@ -43,7 +43,7 @@ $sthInsertRequestType->finish();
# Only one email Adress type so far
my $sthNew = $dbhNew->prepare("INSERT INTO address_type(name) values('paypal_payer')");
my $paypalPayerEmailAddresTypeId = $dbhNew->last_insert_id("","","","");
my $paypalPayerTypeId = $dbhNew->last_insert_id("","","","");
$sthNew->finish();
# Legacy fulfillment confirmation
@ -54,22 +54,22 @@ $sthNew->finish();
my $sthNewInsertSupporter = $dbhNew->prepare('INSERT INTO supporter(' .
'ledger_entity_id, display_name, public_ack) values (?, ?, ?)');
my $sthInsertEmailAddress = $dbhNew->prepare('INSERT INTO email_address(supporter_id, email_address, email_type_id, date_encountered)' .
"values(?, ?, $paypalPayerEmailAddresTypeId, date('now'))");
my $sthInsertEmailAddress = $dbhNew->prepare('INSERT INTO email_address(email_address, type_id, date_encountered)' .
"values(?, ?, $paypalPayerTypeId, date('now'))");
my $sthLinkSupporterToEmail = $dbhNew->prepare('INSERT INTO supporter_email_address_mapping(supporter_id, email_address_id, preferred)' .
"values(?, ?, $paypalPayerEmailAddresTypeId, date('now'), 1)");
"values(?, ?, $paypalPayerTypeId, date('now'), 1)");
my $sthLinkSupporterToPostal = $dbhNew->prepare('INSERT INTO supporter_postal_address_mapping(supporter_id, postal_address_id, preferred)' .
"values(?, ?, $paypalPayerEmailAddresTypeId, date('now'), 1)");
"values(?, ?, $paypalPayerTypeId, date('now'), 1)");
my $sthInsertRequest = $dbhNew->prepare('INSERT INTO request' .
'(supporter_id, request_type_id, request_configuration_id, date_requested, fulfillment_id, notes) ' .
"values(?, ?, ?, date('now'), ?," .
'"import of old database; exact date of this request is unknown")');
my $sthPostalAddress = 'INSERT INTO postal_address(formatted_address, date_encountered)' .
"VALUES(? , date('now'))";
my $sthPostalAddress = 'INSERT INTO postal_address(formatted_address, type_id, date_encountered)' .
"VALUES(?, $paypalPayerTypeId, date('now'))";
my $sthOld = $dbhOld->prepare('SELECT * from supporters order by id;');
$sthOld->execute();