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

Last change on this file since 803 was 803, checked in by thomasb, 6 years ago

IPv6 Compatability

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1-- RoundCube Webmail initial database structure
2-- Version 0.1-rc1
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  changed 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  html_signature tinyint NOT NULL default '0'
63);
64
65CREATE INDEX ix_identities_user_id ON identities(user_id);
66
67
68-- --------------------------------------------------------
69
70--
71-- Table structure for table users
72--
73
74CREATE TABLE users (
75  user_id integer NOT NULL PRIMARY KEY,
76  username varchar(128) NOT NULL default '',
77  mail_host varchar(128) NOT NULL default '',
78  alias varchar(128) NOT NULL default '',
79  created datetime NOT NULL default '0000-00-00 00:00:00',
80  last_login datetime NOT NULL default '0000-00-00 00:00:00',
81  language varchar(5) NOT NULL default 'en',
82  preferences text NOT NULL default ''
83);
84
85
86-- --------------------------------------------------------
87
88--
89-- Table structure for table session
90--
91
92CREATE TABLE session (
93  sess_id varchar(40) NOT NULL PRIMARY KEY,
94  created datetime NOT NULL default '0000-00-00 00:00:00',
95  changed datetime NOT NULL default '0000-00-00 00:00:00',
96  ip varchar(40) NOT NULL default '',
97  vars text NOT NULL
98);
99
100
101-- --------------------------------------------------------
102
103--
104-- Table structure for table messages
105--
106
107CREATE TABLE messages (
108  message_id integer NOT NULL PRIMARY KEY,
109  user_id integer NOT NULL default '0',
110  del tinyint NOT NULL default '0',
111  cache_key varchar(128) NOT NULL default '',
112  created datetime NOT NULL default '0000-00-00 00:00:00',
113  idx integer NOT NULL default '0',
114  uid integer NOT NULL default '0',
115  subject varchar(255) NOT NULL default '',
116  "from" varchar(255) NOT NULL default '',
117  "to" varchar(255) NOT NULL default '',
118  cc varchar(255) NOT NULL default '',
119  date datetime NOT NULL default '0000-00-00 00:00:00',
120  size integer NOT NULL default '0',
121  headers text NOT NULL,
122  structure text
123);
124
125CREATE INDEX ix_messages_user_id ON messages(user_id);
126CREATE INDEX ix_messages_cache_key ON messages(cache_key);
127CREATE INDEX ix_messages_idx ON messages(idx);
128CREATE INDEX ix_messages_uid ON messages(uid);
Note: See TracBrowser for help on using the repository browser.