From f8b6c4dc89f518ca541ee8a3c3a100d5636e32dc Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 23 Apr 2017 12:37:23 +1000 Subject: [PATCH] update users.sq3 utiltity --- utils/sql_update/users_sql_update.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/sql_update/users_sql_update.pl b/utils/sql_update/users_sql_update.pl index bd4a7c0..2a025bf 100755 --- a/utils/sql_update/users_sql_update.pl +++ b/utils/sql_update/users_sql_update.pl @@ -116,3 +116,23 @@ if (check_exists("nodemsgs") == 0) { $dbh->do($sql); $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; +} \ No newline at end of file