some upgrade bug fixes

This commit is contained in:
JT Smith 2006-05-12 18:30:26 +00:00
parent 462c12c814
commit b38167d415
2 changed files with 28 additions and 19 deletions

View file

@ -9,10 +9,17 @@ save you many hours of grief.
6.99.0 6.99.0
-------------------------------------------------------------------- --------------------------------------------------------------------
* The 6.99 series is the last round of changes before 7.0.0 is * The 6.99 series is the last round of changes before 7.0.0 is
released. It will serve as the beta, gamma, and release released. It will serve as the beta, gamma, and release
candidates for 7.0.0. candidates for 7.0.0.
* The "messageLog" table will be deleted during the upgrade process,
and all of the messages in it. This is because the messages
contained in there are no longer useful because they won't
work with the new workflow system. If you need the data in
that table, you should save it before performing the upgrade.
* The session system has been replaced by a new object-oriented one, * The session system has been replaced by a new object-oriented one,
which has caused massive API changes. Please consult which has caused massive API changes. Please consult
migration.txt to bring your custom code up to date with the migration.txt to bring your custom code up to date with the

View file

@ -241,25 +241,26 @@ sub convertMessageLogToInbox {
message mediumtext message mediumtext
)"); )");
$session->db->write("alter table Matrix_listing add column approvalMessageId varchar(22) binary"); $session->db->write("alter table Matrix_listing add column approvalMessageId varchar(22) binary");
my $prepared = $session->db->prepare("insert into inbox (messageId, status, dateStamp, completedOn, completedBy, userId, subject, message) # not migrating cuz it's not useful, but leaving this code here in case someone decides they need the data migrated
values ( ?,?,?,?,?,?,?,? )"); # my $prepared = $session->db->prepare("insert into inbox (messageId, status, dateStamp, completedOn, completedBy, userId, subject, message)
my $rs = $session->db->read("select * from messageLog"); # values ( ?,?,?,?,?,?,?,? )");
while (my $data = $rs->hashRef) { # my $rs = $session->db->read("select * from messageLog");
$prepared->execute([ # while (my $data = $rs->hashRef) {
$session->id->generate, # $prepared->execute([
'completed', # $session->id->generate,
$data->{dateOfEntry}, # 'completed',
time(), # $data->{dateOfEntry},
'3', # time(),
$data->{userId}, # '3',
$data->{subject}, # $data->{userId},
$data->{message} # $data->{subject} || "No Subject",
]); # $data->{message}
} # ]);
# }
$session->db->write("delete from userProfileField where fieldname='INBOXNotifications'"); $session->db->write("delete from userProfileField where fieldname='INBOXNotifications'");
$session->db->write("delete from userProfileData where fieldname='INBOXNotifications'"); $session->db->write("delete from userProfileData where fieldname='INBOXNotifications'");
$session->db->write("drop table if exists messageLog"); $session->db->write("drop table if exists messageLog");
$rs = $session->db->read("select distinct assetId from template where namespace='Operation/MessageLog/View' or namespace='Operation/MessageLog/Message'"); my $rs = $session->db->read("select distinct assetId from template where namespace='Operation/MessageLog/View' or namespace='Operation/MessageLog/Message'");
while (my ($id) = $rs->array) { while (my ($id) = $rs->array) {
my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Template"); my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Template");
if (defined $asset) { if (defined $asset) {
@ -407,7 +408,7 @@ sub addWorkflow {
my $rs = $session->db->read("select assetId from assetData where status='denied'"); my $rs = $session->db->read("select assetId from assetData where status='denied'");
while (my ($id) = $rs->array) { while (my ($id) = $rs->array) {
my $asset = WebGUI::Asset->newByDynamicClass($session, $id); my $asset = WebGUI::Asset->newByDynamicClass($session, $id);
if ($asset->get("status") eq "denied") { if (defined $asset && $asset->get("status") eq "denied") {
$asset->purge; $asset->purge;
} }
} }
@ -933,12 +934,13 @@ sub addSearchEngine {
my $deleteWobject = $session->db->prepare("delete from wobject where assetId=?"); my $deleteWobject = $session->db->prepare("delete from wobject where assetId=?");
my $deleteAssetData = $session->db->prepare("delete from assetData where assetId=?"); my $deleteAssetData = $session->db->prepare("delete from assetData where assetId=?");
foreach my $id (@searchIds) { foreach my $id (@searchIds) {
$deleteWobject->execute($id); $deleteWobject->execute([$id]);
$deleteAssetData->execute($id); $deleteAssetData->execute([$id]);
} }
$deleteWobject->finish; $deleteWobject->finish;
$deleteAssetData->finish; $deleteAssetData->finish;
$session->config->deleteFromArray("assets","WebGUI::Asset::Wobject::IndexedSearch"); $session->config->deleteFromArray("assets","WebGUI::Asset::Wobject::IndexedSearch");
$session->config->addToArray("assets","WebGUI::Asset::Wobject::Search");
$session->db->write("drop table if exists IndexedSearch"); $session->db->write("drop table if exists IndexedSearch");
$session->db->write("drop table if exists IndexedSearch_default"); $session->db->write("drop table if exists IndexedSearch_default");
$session->db->write("drop table if exists IndexedSearch_default_data"); $session->db->write("drop table if exists IndexedSearch_default_data");