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
--------------------------------------------------------------------
* 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
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,
which has caused massive API changes. Please consult
migration.txt to bring your custom code up to date with the

View file

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