Add option to enable / disable external editor

This commit is contained in:
Andrew Pamment
2017-09-11 16:10:38 +10:00
parent d5e9f84c6e
commit a259082692
6 changed files with 62 additions and 10 deletions

View File

@@ -135,4 +135,24 @@ if (check_exists("codepage") == 0) {
my $sql = "ALTER TABLE users ADD COLUMN codepage INTEGER DEFAULT 0";
$dbh->do($sql);
$dbh->disconnect;
}
}
if (check_exists("exteditor") == 0) {
print "Column \"exteditor\" 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 exteditor INTEGER DEFAULT 2";
$dbh->do($sql);
$dbh->disconnect;
}