Projet

Général

Profil

test_log.sql

Benjamin Bohard, 08/09/2022 09:40

Télécharger (3,75 ko)

 
1
-- Creation de la base de donnée roundcube et de son utilisateur
2
CREATE DATABASE `testbinlog`;
3

    
4
USE `testbinlog`;
5

    
6

    
7
--
8
-- Table structure for table `users`
9
--
10

11
CREATE TABLE `users` (
12
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
13
  `username` varchar(128) NOT NULL,
14
  `mail_host` varchar(128) NOT NULL,
15
  `alias` varchar(128) NOT NULL,
16
  `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
17
  `last_login` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
18
  `language` varchar(5) DEFAULT NULL,
19
  `preferences` text,
20
  PRIMARY KEY (`user_id`),
21
  KEY `username_index` (`username`),
22
  KEY `alias_index` (`alias`)
23
);
24

    
25
--
26
-- Table structure for table `session`
27
--
28

29
CREATE TABLE `session` (
30
  `sess_id` varchar(40) NOT NULL,
31
  `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
32
  `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
33
  `ip` varchar(40) NOT NULL,
34
  `vars` mediumtext NOT NULL,
35
  PRIMARY KEY (`sess_id`),
36
  KEY `changed_index` (`changed`)
37
);
38

    
39
--
40
-- Table structure for table `cache`
41
--
42

43
CREATE TABLE `cache` (
44
  `cache_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
45
  `cache_key` varchar(128) CHARACTER SET ascii NOT NULL,
46
  `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
47
  `data` longtext NOT NULL,
48
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
49
  PRIMARY KEY (`cache_id`),
50
  KEY `created_index` (`created`),
51
  KEY `user_cache_index` (`user_id`,`cache_key`),
52
  CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
53
);
54

    
55
--
56
-- Table structure for table `contacts`
57
--
58

59
CREATE TABLE `contacts` (
60
  `contact_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
61
  `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
62
  `del` tinyint(1) NOT NULL DEFAULT '0',
63
  `name` varchar(128) NOT NULL,
64
  `email` varchar(128) NOT NULL,
65
  `firstname` varchar(128) NOT NULL,
66
  `surname` varchar(128) NOT NULL,
67
  `vcard` text,
68
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
69
  PRIMARY KEY (`contact_id`),
70
  KEY `user_contacts_index` (`user_id`,`email`),
71
  CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
72
);
73

    
74
--
75
-- Table structure for table `identities`
76
--
77

78
CREATE TABLE `identities` (
79
  `identity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
80
  `del` tinyint(1) NOT NULL DEFAULT '0',
81
  `standard` tinyint(1) NOT NULL DEFAULT '0',
82
  `name` varchar(128) NOT NULL,
83
  `organization` varchar(128) NOT NULL DEFAULT '',
84
  `email` varchar(128) NOT NULL,
85
  `reply-to` varchar(128) NOT NULL DEFAULT '',
86
  `bcc` varchar(128) NOT NULL DEFAULT '',
87
  `signature` text,
88
  `html_signature` tinyint(1) NOT NULL DEFAULT '0',
89
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
90
  PRIMARY KEY (`identity_id`),
91
  KEY `user_id_fk_identities` (`user_id`),
92
  CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
93
);
94

    
95
--
96
-- Table structure for table `messages`
97
--
98

99
CREATE TABLE `messages` (
100
  `message_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
101
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
102
  `del` tinyint(1) NOT NULL DEFAULT '0',
103
  `cache_key` varchar(128) CHARACTER SET ascii NOT NULL,
104
  `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
105
  `idx` int(11) unsigned NOT NULL DEFAULT '0',
106
  `uid` int(11) unsigned NOT NULL DEFAULT '0',
107
  `subject` varchar(255) NOT NULL,
108
  `from` varchar(255) NOT NULL,
109
  `to` varchar(255) NOT NULL,
110
  `cc` varchar(255) NOT NULL,
111
  `date` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
112
  `size` int(11) unsigned NOT NULL DEFAULT '0',
113
  `headers` text NOT NULL,
114
  `structure` text,
115
  PRIMARY KEY (`message_id`),
116
  UNIQUE KEY `uniqueness` (`user_id`,`cache_key`,`uid`),
117
  KEY `created_index` (`created`),
118
  KEY `index_index` (`user_id`,`cache_key`,`idx`),
119
  CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
120
);
121

    
122

    
123

    
124

    
125
DROP DATABASE `testbinlog`;
126