mirror of
https://github.com/fhem/fhem-mirror.git
synced 2024-11-22 09:49:50 +00:00
configDB: add debug option to support migration problems
git-svn-id: https://svn.fhem.de/fhem/trunk@27183 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
18bea89870
commit
47a7ef1658
@ -185,6 +185,7 @@ sub CommandConfigdb {
|
||||
|
||||
when ('migrate') {
|
||||
return "\n Migration not possible. Already running with configDB!" if $configfile eq 'configDB';
|
||||
$data{cfgDB_debug} = 1 if (lc($param1) eq 'debug');
|
||||
Log3('configdb', 4, "configdb: migration requested.");
|
||||
$ret = _cfgDB_Migrate;
|
||||
}
|
||||
|
@ -525,6 +525,7 @@ sub cfgDB_SaveCfg { ## prototype used in fhem.pl
|
||||
$t = localtime;
|
||||
$out = "#created $t";
|
||||
push @rowList, $out;
|
||||
Debug "\n".join("\n",@rowList) if defined($data{cfgDB_debug});
|
||||
return @rowList if defined($data{cfgDB_rawList});
|
||||
|
||||
# Insert @rowList into database table
|
||||
@ -751,6 +752,7 @@ sub _cfgDB_Connect {
|
||||
# add configuration entry into fhemconfig
|
||||
sub _cfgDB_InsertLine {
|
||||
my ($fhem_dbh, $uuid, $line, $counter) = @_;
|
||||
Log 0, "configDB: $line" if defined($data{cfgDB_debug});
|
||||
my ($c,$d,$p1,$p2) = split(/ /, $line, 4);
|
||||
my $sth = $fhem_dbh->prepare('INSERT INTO fhemconfig values (?, ?, ?, ?, ?, ?)');
|
||||
$sth->execute($c, $d, $p1, $p2, $counter, $uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user