Fix the EMS upgrade script for 7.5.11 to only create badges for users

who completed their transactions.
This commit is contained in:
Colin Kuskie 2008-07-30 04:24:45 +00:00
parent 752d6f3456
commit 3b0d02fad2
2 changed files with 10 additions and 2 deletions

View file

@ -6,6 +6,7 @@
- Inbox and ?op=viewInbox can now handle millions of rows without taking 10 minutes to return
some results
- Exposed a form element for the GalleryAlbum Others Can Add property
- fixed: EMS 2.0 migration badges
7.5.18
- fixed: Collateral Image Manager broken in Firefox 3

View file

@ -55,8 +55,8 @@ addShoppingHandler($session);
addAddressBook($session);
insertCommercePayDriverTable($session);
addPaymentDrivers($session);
upgradeEMS($session); ##Need the transaction log for EMS upgrade.
convertTransactionLog($session);
upgradeEMS($session);
migrateOldProduct($session);
mergeProductsWithCommerce($session);
deleteOldProductTemplates($session);
@ -686,7 +686,14 @@ sub upgradeEMS {
}
}
print "\t\t\tMigrating old registrants for $emsId.\n" unless ($quiet);
my $registrantResults = $db->read("select * from EventManagementSystem_badges where assetId=?",[$emsId]);
my $registrantResults = $db->read(<<EOSQL,[$emsId]);
select * from EventManagementSystem_badges as b
join EventManagementSystem_registrations as r on b.badgeId=r.badgeId
join EventManagementSystem_purchases as p on p.purchaseId=r.purchaseId
join transaction as t on p.transactionId=t.transactionId
where b.assetId=? and t.status='Completed'
EOSQL
#"select * from EventManagementSystem_badges where assetId=?",[$emsId]);
while (my $registrantData = $registrantResults->hashRef) {
$db->setRow("EMSRegistrant","badgeId",{
badgeId => "new",