mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
configDB.pm: improve migration check
git-svn-id: https://svn.fhem.de/fhem/trunk@14982 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0552a07ce1
commit
4afdf1f419
@ -124,6 +124,8 @@
|
||||
#
|
||||
# 2017-07-17 - changed store files base64 encoded
|
||||
#
|
||||
# 2017-08-31 - changed improve table_info for migration check
|
||||
#
|
||||
##############################################################################
|
||||
=cut
|
||||
|
||||
@ -220,8 +222,6 @@ if ($count > 1) {
|
||||
my $cfgDB_dbconn = $dbconfig{connection};
|
||||
my $cfgDB_dbuser = $dbconfig{user};
|
||||
my $cfgDB_dbpass = $dbconfig{password};
|
||||
my $cfgDB_b64 = $dbconfig{b64};
|
||||
$cfgDB_b64 //= 0;
|
||||
my $cfgDB_dbtype;
|
||||
my $cfgDB_filename;
|
||||
|
||||
@ -300,8 +300,11 @@ sub cfgDB_Init() {
|
||||
|
||||
### migrate fhembinfilesave to fhemb64filesave
|
||||
# check: fhembinfilesave exists?
|
||||
my $sth_test = $fhem_dbh->table_info("%", "%", "fhembinfilesave", 'TABLE');
|
||||
if ($sth_test->fetch() && (!$cfgDB_b64)) {
|
||||
my $sth_test = $fhem_dbh->table_info(undef, 'public', "fhembinfilesave", 'TABLE');
|
||||
$sth_test->execute;
|
||||
my @info = $sth_test->fetchrow_array;
|
||||
my $exists = scalar @info;
|
||||
if ($exists) {
|
||||
$sth_test->finish();
|
||||
# check: any files for migratione?
|
||||
$count = undef;
|
||||
|
Loading…
Reference in New Issue
Block a user