documentation added to tables

This commit is contained in:
Marc Wäckerlin
2015-11-05 16:01:45 +00:00
parent a45ad12fd1
commit af4f162f23
3 changed files with 44 additions and 2 deletions

View File

@@ -24,7 +24,19 @@
require_once("opendb.php");
try {
$db->query('create table if not exists user (name varchar(50) not null primary key, pubkey text not null) character set utf8 engine=innodb;');
$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);
} catch (Exception $e) {
error('database error on server');
}