From: Will Budicm Date: Wed, 20 May 2020 10:33:06 +0000 (+1000) Subject: v. change, updated. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=73aaa67bb9038439b74d9205ef5647f246019654;p=LifeLog.git v. change, updated. --- diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 073fe61..c127a93 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -284,7 +284,8 @@ sub checkCreateTables { } elsif($hasLogTbl && $DEF_VERSION > $DB_VERSION && $DB_VERSION < 2.0){ #dev 1.9 main log view has changed in 1.8..1.9, above scope will perform anyway, its drop, to be recreated later. - $db->do('DROP TABLE VW_LOG;');delete($curr_tables{'VW_LOG'}); + $db->do('DROP VIEW VW_LOG;');delete($curr_tables{'VW_LOG'}); + $changed = 1; } if(!$hasLogTbl) { diff --git a/htdocs/cgi-bin/system/modules/Settings.pm b/htdocs/cgi-bin/system/modules/Settings.pm index a49285e..d1898bd 100644 --- a/htdocs/cgi-bin/system/modules/Settings.pm +++ b/htdocs/cgi-bin/system/modules/Settings.pm @@ -17,7 +17,7 @@ use DBI; use constant CIPHER_KEY => '95d7a85ba891da'; #DEFAULT SETTINGS HERE! -our $RELEASE_VER = '1.8'; +our $RELEASE_VER = '2.0'; our $TIME_ZONE = 'Australia/Sydney'; our $LANGUAGE = 'English'; our $PRC_WIDTH = '60'; @@ -211,7 +211,7 @@ sub renumerate { my $db = shift; #Renumerate Log! Copy into temp. table. my $sql; - selectRecords($db, 'CREATE TABLE life_log_temp_table AS SELECT * FROM LOG;'); + selectRecords($db,'CREATE TABLE life_log_temp_table AS SELECT * FROM LOG;'); #update notes table with new log id only for reference sake. my $st = selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;'); while(my @row =$st->fetchrow_array()) { @@ -232,15 +232,17 @@ sub renumerate { } # Delete any possible orphaned Notes records. + $st->finish(); $st = selectRecords($db, "SELECT LID, LOG.rowid from NOTES LEFT JOIN LOG ON NOTES.LID = LOG.rowid WHERE LOG.rowid is NULL;"); while($st->fetchrow_array()) { $db->do("DELETE FROM NOTES WHERE LID=".$_[0].";") } + $st->finish(); $db->do('DROP TABLE LOG;'); $db->do(&createLOGStmt); $db->do('INSERT INTO LOG (ID_CAT, ID_RTF, DATE, LOG, AMOUNT,AFLAG,STICKY) - SELECT ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM life_log_temp_table ORDER by DATE;'); + SELECT ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM life_log_temp_table ORDER by DATE;'); $db->do('DROP TABLE life_log_temp_table;'); }