Make showing node msgs optional

This commit is contained in:
Andrew Pamment
2017-04-19 15:57:29 +10:00
parent 96a613d706
commit 71f9fe9b92
6 changed files with 54 additions and 19 deletions

View File

@@ -97,3 +97,22 @@ if (check_exists("bwavepktno") == 0) {
$dbh->disconnect;
}
if (check_exists("nodemsgs") == 0) {
print "Column \"nodemsgs\" doesn't exist... adding..\n";
my ($needed) = @_;
my $dsn = "dbi:SQLite:dbname=$dbfile";
my $user = "";
my $password = "";
my $dbh = DBI->connect($dsn, $user, $password, {
PrintError => 0,
RaiseError => 1,
AutoCommit => 1,
FetchHashKeyName => 'NAME_lc',
});
my $sql = "ALTER TABLE users ADD COLUMN nodemsgs INTEGER DEFAULT 1";
$dbh->do($sql);
$dbh->disconnect;
}