]> git.defcon.no Git - hermes/blob - doc/sql-data/structure-hermes.sql
First stab at a naive permissions-tool
[hermes] / doc / sql-data / structure-hermes.sql
1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
2 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
3 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
4 /*!40101 SET NAMES utf8 */;
5 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
6 /*!40103 SET TIME_ZONE='+00:00' */;
7 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
8 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
9 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
10 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
11
12
13 SET @saved_cs_client = @@character_set_client;
14 SET character_set_client = utf8;
15
16 --
17 -- Table structure for table `apikeys`
18 --
19
20 CREATE TABLE `apikeys` (
21 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
22 `host` varchar(64) NOT NULL,
23 `apikey` varchar(128) NOT NULL,
24 PRIMARY KEY (`apikey`)
25 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
26
27 --
28 -- Table structure for table `authorizations`
29 --
30
31 CREATE TABLE `authorizations` (
32 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
33 `authid` varchar(255) NOT NULL,
34 `type` varchar(16) NOT NULL,
35 `access_level` int(11) NOT NULL,
36 PRIMARY KEY (`authid`)
37 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
38
39 --
40 -- Table structure for table `number_pool`
41 --
42
43 CREATE TABLE `number_pool` (
44 `id` int(11) NOT NULL auto_increment,
45 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
46 `number` varchar(128) character set utf8 NOT NULL,
47 PRIMARY KEY (`id`)
48 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
49
50 --
51 -- Table structure for table `phones`
52 --
53
54 CREATE TABLE `phones` (
55 `id` int(11) NOT NULL auto_increment,
56 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
57 `mac` varchar(32) character set utf8 NOT NULL,
58 `user_rel` int(11) NOT NULL,
59 `ua_type` int(11) default NULL,
60 PRIMARY KEY (`id`)
61 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
62
63 --
64 -- Table structure for table `servers`
65 --
66
67 CREATE TABLE `servers` (
68 `id` int(11) NOT NULL auto_increment,
69 `domain` varchar(255) character set utf8 NOT NULL,
70 `registrar` varchar(255) character set utf8 default NULL,
71 `r_port` int(11) default NULL,
72 `proxy` varchar(255) character set utf8 default NULL,
73 `p_port` int(11) default NULL,
74 `prov_url` text,
75 PRIMARY KEY (`id`)
76 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
77
78 --
79 -- Table structure for table `sessionkeys`
80 --
81
82 CREATE TABLE `sessionkeys` (
83 `sessid` varchar(255) NOT NULL,
84 `session` varchar(128) NOT NULL,
85 `authid` varchar(128) NOT NULL,
86 `client` varchar(255) NOT NULL,
87 `key` varchar(128) NOT NULL,
88 `last` datetime default NULL,
89 PRIMARY KEY (`session`,`authid`)
90 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
91
92 --
93 -- Table structure for table `users`
94 --
95
96 CREATE TABLE `users` (
97 `id` int(11) NOT NULL auto_increment,
98 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
99 `username` varchar(128) character set utf8 NOT NULL,
100 `password` varchar(128) character set utf8 NOT NULL,
101 `displayname` varchar(255) character set utf8 NOT NULL,
102 `domain` varchar(255) character set utf8 NOT NULL,
103 `registrar` varchar(255) character set utf8 default NULL,
104 `r_port` int(11) default NULL,
105 `proxy` varchar(255) character set utf8 default NULL,
106 `p_port` int(11) default NULL,
107 `authid` varchar(128) character set utf8 default NULL,
108 `dialplan` varchar(255) character set utf8 default NULL,
109 `linetext` varchar(64) character set utf8 default NULL,
110 PRIMARY KEY (`id`)
111 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
112
113 SET character_set_client = @saved_cs_client;
114
115 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
116
117 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
118 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
119 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
120 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
121 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
122 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
123 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;