update users.sq3 utiltity

This commit is contained in:
Andrew Pamment 2017-04-23 12:37:23 +10:00
parent d76ac1e151
commit f8b6c4dc89

View File

@ -116,3 +116,23 @@ if (check_exists("nodemsgs") == 0) {
$dbh->do($sql); $dbh->do($sql);
$dbh->disconnect; $dbh->disconnect;
} }
if (check_exists("codepage") == 0) {
print "Column \"codepage\" 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 codepage INTEGER DEFAULT 0";
$dbh->do($sql);
$dbh->disconnect;
}