split sql schema from php

This commit is contained in:
Marc Wäckerlin
2015-11-06 15:39:49 +00:00
parent af4f162f23
commit 66083bef1c
5 changed files with 28 additions and 37 deletions

View File

@@ -24,19 +24,7 @@
require_once("opendb.php");
try {
$query = <<<EOD
create table if not exists
user (
name
varchar(50) not null primary key
comment "unique name of the user",
pubkey
text not null
comment "armored gnupg public key of the user"
) character set utf8 engine=innodb
comment="list of all registered users and their public keys";
EOD;
$db->query($query);
$db->query(file_get_contents("usertable.sql"));
} catch (Exception $e) {
error('database error on server');
}