-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
229 lines (177 loc) · 6.58 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.1.59)
# Datenbank: pipinstrasse
# Erstellungsdauer: 2013-06-08 19:17:57 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Export von Tabelle board
# ------------------------------------------------------------
CREATE TABLE `board` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`nachricht` text CHARACTER SET latin1 NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle chat
# ------------------------------------------------------------
CREATE TABLE `chat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`message` varchar(255) NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle comments
# ------------------------------------------------------------
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_type` varchar(20) NOT NULL,
`object_id` int(11) DEFAULT NULL,
`von` int(11) NOT NULL,
`comment` text,
`liked` tinyint(4) NOT NULL DEFAULT '0',
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `object` (`object_type`,`object_id`),
KEY `von` (`von`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle invitations
# ------------------------------------------------------------
CREATE TABLE `invitations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`object_type` varchar(20) NOT NULL,
`object_id` int(11) NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle messages
# ------------------------------------------------------------
CREATE TABLE `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`an` int(11) NOT NULL,
`gift` varchar(20) CHARACTER SET latin1 NOT NULL,
`nachricht` text CHARACTER SET latin1 NOT NULL,
`created` datetime NOT NULL,
`viewed` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle migrations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`last_id` int(11) NOT NULL,
`updated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` (`last_id`, `updated`)
VALUES
(11,'2013-06-08 19:55:37');
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
# Export von Tabelle pages
# ------------------------------------------------------------
CREATE TABLE `pages` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`slug` varchar(100) NOT NULL DEFAULT '',
`public` tinyint(1) NOT NULL DEFAULT '0',
`title` varchar(100) NOT NULL DEFAULT '',
`body` text NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `slug` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle photos
# ------------------------------------------------------------
CREATE TABLE `photos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`topic_id` int(11) DEFAULT NULL,
`von` int(11) NOT NULL,
`seq` int(11) NOT NULL DEFAULT '0',
`title` varchar(100) CHARACTER SET latin1 NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `topic_id` (`topic_id`,`seq`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle stream
# ------------------------------------------------------------
CREATE TABLE `stream` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`object_type` varchar(20) CHARACTER SET latin1 NOT NULL,
`object_id` int(11) NOT NULL,
`title` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `created` (`created`),
KEY `von` (`von`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle topics
# ------------------------------------------------------------
CREATE TABLE `topics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`von` int(11) NOT NULL,
`shared` tinyint(1) NOT NULL COMMENT 'Alben, in die von jedem Bilder eingestellt werden dürfen',
`title` varchar(100) NOT NULL,
`slug` varchar(100) NOT NULL,
`description` text NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `shared` (`shared`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Export von Tabelle users
# ------------------------------------------------------------
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`slug` varchar(255) CHARACTER SET latin1 NOT NULL,
`mail` varchar(255) CHARACTER SET latin1 NOT NULL,
`roles` varchar(100) CHARACTER SET latin1 NOT NULL,
`password` varchar(255) CHARACTER SET latin1 NOT NULL,
`recover` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
`vorname` varchar(255) CHARACTER SET latin1 NOT NULL,
`nachname` varchar(255) CHARACTER SET latin1 NOT NULL,
`hausnummer` varchar(10) CHARACTER SET latin1 NOT NULL,
`hausnr_sort` int(11) NOT NULL DEFAULT '0',
`bio` text CHARACTER SET latin1 NOT NULL,
`invited_by` int(11) DEFAULT NULL,
`invited` datetime DEFAULT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
`chat` datetime DEFAULT NULL,
`online` datetime DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `mail` (`mail`),
UNIQUE KEY `slug` (`slug`),
UNIQUE KEY `recover` (`recover`),
KEY `online` (`online`),
KEY `chat` (`chat`),
KEY `hausnr_sort` (`hausnr_sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;