### New Development
+* Bug 35. SQL migration, version update, not working for PG based databases.
* JS - Event, on expense sum in log numbers found at beginning of lines.
* ✔ Update to CNF v.2.2, branch to $RELEASE_VER = 2.3, Earth Stage initial.
* Plugins
### v. 2.2 Encountered/Fixed
+* Bug 35, Migration and version updating SQL is wrong for PG database, it doesn't have rowid's.
* Bug 34, DB fix in config, removes associated RTF documents, for some reason.
* ✔ Bug 33 Changing session timeout in config to an lib. background unparsable format cause unrecoverable system error.
* i.e. Putting +1hr instead of +1h.
Note Remove -> '!' prefix to tag name, to enable, set,
and override any previously set from now on, top to end of file approach.
-<<DBI_SOURCE<DBI:SQLite:>>>
+<<!DBI_SOURCE<DBI:SQLite:>>>
# ProgresSQL DB driver.
-<<!DBI_SOURCE<DBI:Pg:host=localhost;>>>
+<<DBI_SOURCE<DBI:Pg:host=localhost;>>>
# LOG actual variable size limit, - 1024 default, 128 minimum value.
<<DBI_LOG_VAR_SIZE<8024>>>
America/Texas=America/Chicago
>>
+<<PLUGINS<
+HelpPlugin->help.pl
+BankingPlugin->banking.pl
+>>
# @See help at bottom of config for all the following.
"<hr><font color=red><b>SERVER ERROR</b></font> on ".DateTime->now().
"<pre>".$pwd."/$0 -> [\n$err]","\n$dbg</pre>",
$cgi->end_html;
- };
+ }
exit;
sub processSubmit {
#exit;
# Autologin credential in file next.
if(@cre &&scalar(@cre)>1){
-
if($alias && $passw && $alias ne $cre[0]){ # Is this an new alias login attempt? If so, autologin is of the agenda.
return; # Note, we do assign entered password even passw as autologin is set. Not entering one bypasses this.
} # If stricter access is required set it to zero in main.cnf, or disable in config.
}
$db -> disconnect();
}
-
}
sub checkPreparePGDB {
return 0;
}
-sub checkCreateTables {
-my ($pst, $sql,$rv, $changed) = 0;
-try{
-
-
+sub checkCreateTables { my ($pst, $sql,$rv, $changed) = 0;
+ try{
# We live check database for available tables now only once.
# If brand new database, this sill returns fine an empty array.
my %curr_tables = ();
$db->do('CREATE TABLE life_log_login_ctr_temp_table AS SELECT * FROM LOG;');
my %notes_ids = ();
if($hasNotesTbl){
- $pst = Settings::selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;');
+ if(Settings::isProgressDB()){
+ $sql='SELECT ID, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;'}
+ else{$sql='SELECT rowid, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;'}
+ $pst = Settings::selectRecords($db, $sql);
while(my @row = $pst->fetchrow_array()) {
my $sql_date = $row[1];;
$sql_date = DateTime::Format::SQLite->parse_datetime($sql_date);
- my $pst2 = Settings::selectRecords($db, "SELECT rowid, DATE FROM life_log_login_ctr_temp_table WHERE RTF > 0 AND DATE = '".$sql_date."';");
+ if(Settings::isProgressDB()){
+ $sql="SELECT ID, DATE FROM life_log_login_ctr_temp_table WHERE RTF > 0 AND DATE = '".$sql_date."';"}
+ else{$sql="SELECT rowid, DATE FROM life_log_login_ctr_temp_table WHERE RTF > 0 AND DATE = '".$sql_date."';"}
+ my $pst2 = Settings::selectRecords($db, $sql);
my @rec = $pst2->fetchrow_array();
if(@rec){
- $db->do("UPDATE NOTES SET LID =". $rec[0]." WHERE LID ==".$row[0].";");
- $pst2 = Settings::selectRecords($db, "SELECT rowid FROM NOTES WHERE LID == ".$rec[0].";");
+ $db->do("UPDATE NOTES SET LID=". $rec[0]." WHERE LID=".$row[0].";");
+ if(Settings::isProgressDB()){
+ $sql="SELECT LID FROM NOTES WHERE LID = ".$rec[0].";"}
+ else{$sql="SELECT rowid FROM NOTES WHERE LID = ".$rec[0].";"}
+ $pst2 = Settings::selectRecords($db, $sql);
@rec = $pst2->fetchrow_array();
if(@rec){
- $notes_ids{$sql_date} = $rec[0];
+ $notes_ids{$sql_date} = $rec[0];
}
}
}
foreach my $date (keys %notes_ids){
#next if(ref($notes_ids{$date}) eq 'HASH');
my $nid = $notes_ids{$date};
- my $stmt= "UPDATE LOG SET RTF =". $nid." WHERE DATE == '".$date."';";
+ my $stmt= "UPDATE LOG SET RTF =". $nid." WHERE DATE = '".$date."';";
try{
$db->do($stmt);
}
my $t ="BYTE"; $t = "SMALLINT" if Settings::isProgressDB();
$db->do("ALTER TABLE LOG ADD COLUMN RTF $t default 0");$changed = 1;
}
- elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;}
-
-
+ elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;}
if(!$hasLogTbl) {
#Then we check if we are login in intereactively back. Interective, logout should bring us to the login screen.
#Bypassing auto login. So to start maybe working on another database, and a new session.
return $cgi->param('autologoff') == 1;
-}catch{
- LifeLogException -> throw(error=>"DSN:".Settings::dsn()." Error:".$@."\nLAST_SQL:".$sql,show_trace=>1);
-}
+ }catch{
+ LifeLogException -> throw(error=>"DSN:".Settings::dsn()." Error:".$@."\nLAST_SQL:".$sql,show_trace=>1);
+ }
}
sub createPageViewExcludeSQL {
sub logPath {$S_ = shift;$LOG_PATH = $S_ if $S_;$LOG_PATH}
sub theme {$THEME}
sub timezone {$TIME_ZONE}
+sub language {$LANGUAGE}
sub sessionExprs {$SESSN_EXPR}
sub imgWidthHeight {$IMG_W_H}
sub pagePrcWidth {$PRC_WIDTH}
my @new = selectRecords($db, $sql)->fetchrow_array();
if(scalar @new > 0){
try{#can fail here, for various reasons.
- $sql="UPDATE NOTES SET LID =". $new[0]." WHERE LID==".$row[0].";";
+ $sql="UPDATE NOTES SET LID =". $new[0]." WHERE LID=".$row[0].";";
$db->do($sql);
}
catch{
- SettingsException->throw(error=>"Database error encountered. sql->$sql", show_trace=>$DEBUG);
+ SettingsException->throw(error=>"\@Settings::renumerate Database error encountered. sql->$sql", show_trace=>$DEBUG);
};
}
}