source: subversion/trunk/roundcubemail/SQL/sqlite.initial.sql @ 88

Last change on this file since 88 was 88, checked in by roundcube, 7 years ago

Re-design of caching (new database table added\!); some bugfixes; Postgres support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1-- RoundCube Webmail initial database structure
2-- Version 0.1a
3--
4
5-- --------------------------------------------------------
6
7--
8-- Table structure for table `cache`
9--
10
11CREATE TABLE cache (
12  cache_id integer NOT NULL PRIMARY KEY,
13  user_id integer NOT NULL default 0,
14  session_id varchar(40) default NULL,
15  cache_key varchar(128) NOT NULL default '',
16  created datetime NOT NULL default '0000-00-00 00:00:00',
17  data longtext NOT NULL
18);
19
20CREATE INDEX ix_cache_user_id ON cache(user_id);
21CREATE INDEX ix_cache_cache_key ON cache(cache_key);
22CREATE INDEX ix_cache_session_id ON cache(session_id);
23
24
25-- --------------------------------------------------------
26
27--
28-- Table structure for table contacts
29--
30
31CREATE TABLE contacts (
32  contact_id integer NOT NULL PRIMARY KEY,
33  user_id integer NOT NULL default '0',
34  created datetime NOT NULL default '0000-00-00 00:00:00',
35  del tinyint NOT NULL default '0',
36  name varchar(128) NOT NULL default '',
37  email varchar(128) NOT NULL default '',
38  firstname varchar(128) NOT NULL default '',
39  surname varchar(128) NOT NULL default '',
40  vcard text NOT NULL default ''
41);
42
43CREATE INDEX ix_contacts_user_id ON contacts(user_id);
44
45-- --------------------------------------------------------
46
47--
48-- Table structure for table identities
49--
50
51CREATE TABLE identities (
52  identity_id integer NOT NULL PRIMARY KEY,
53  user_id integer NOT NULL default '0',
54  del tinyint NOT NULL default '0',
55  standard tinyint NOT NULL default '0',
56  name varchar(128) NOT NULL default '',
57  organization varchar(128) default '',
58  email varchar(128) NOT NULL default '',
59  "reply-to" varchar(128) NOT NULL default '',
60  bcc varchar(128) NOT NULL default '',
61  signature text NOT NULL default ''
62);
63
64CREATE INDEX ix_identities_user_id ON identities(user_id);
65
66
67-- --------------------------------------------------------
68
69--
70-- Table structure for table users
71--
72
73CREATE TABLE users (
74  user_id integer NOT NULL PRIMARY KEY,
75  username varchar(128) NOT NULL default '',
76  mail_host varchar(128) NOT NULL default '',
77  alias varchar(128) NOT NULL default '',
78  created datetime NOT NULL default '0000-00-00 00:00:00',
79  last_login datetime NOT NULL default '0000-00-00 00:00:00',
80  language varchar(5) NOT NULL default 'en',
81  preferences text NOT NULL default ''
82);
83
84
85-- --------------------------------------------------------
86
87--
88-- Table structure for table session
89--
90
91CREATE TABLE session (
92  sess_id varchar(40) NOT NULL PRIMARY KEY,
93  created datetime NOT NULL default '0000-00-00 00:00:00',
94  changed datetime NOT NULL default '0000-00-00 00:00:00',
95  ip varchar(15) NOT NULL default '',
96  vars text NOT NULL
97);
98
99
100-- --------------------------------------------------------
101
102--
103-- Table structure for table messages
104--
105
106CREATE TABLE messages (
107  message_id integer NOT NULL PRIMARY KEY,
108  user_id integer NOT NULL default '0',
109  del tinyint NOT NULL default '0',
110  cache_key varchar(128) NOT NULL default '',
111  idx integer NOT NULL default '0',
112  uid integer NOT NULL default '0',
113  subject varchar(255) NOT NULL default '',
114  "from" varchar(255) NOT NULL default '',
115  "to" varchar(255) NOT NULL default '',
116  cc varchar(255) NOT NULL default '',
117  date datetime NOT NULL default '0000-00-00 00:00:00',
118  size integer NOT NULL default '0',
119  headers text NOT NULL,
120  body text
121);
122
123CREATE INDEX ix_messages_user_id ON messages(user_id);
124CREATE INDEX ix_messages_cache_key ON messages(cache_key);
Note: See TracBrowser for help on using the repository browser.