blob: acade56038de4e4bc226a781e17e6656262b04ae [file] [log] [blame]
Till Westmannfd733ee2014-07-10 00:57:37 -07001drop dataverse TinySocial if exists;
2create dataverse TinySocial;
3use dataverse TinySocial;
4
5create type EmploymentType as open {
6 organization-name: string,
7 start-date: date,
8 end-date: date?
9}
10
11create type MugshotUserType as {
12 id: int32,
13 alias: string,
14 name: string,
15 user-since: datetime,
16 address: {
17 street: string,
18 city: string,
19 state: string,
20 zip: string,
21 country: string
22 },
23 friend-ids: {{ int32 }},
24 employment: [EmploymentType]
25}
26
27create type MugshotMessageType as closed {
28 message-id: int32,
29 author-id: int32,
30 timestamp: datetime,
31 in-response-to: int32?,
32 sender-location: point?,
33 tags: {{ string }},
34 message: string
35}
36
37create dataset MugshotUsers(MugshotUserType)
38 primary key id;
39create dataset MugshotMessages(MugshotMessageType)
40 primary key message-id;
41
42create index msUserSinceIdx
43 on MugshotUsers(user-since);
44create index msTimestampIdx
45 on MugshotMessages(timestamp);
46create index msAuthorIdx
47 on MugshotMessages(author-id) type btree;
48create index msSenderLocIndex
49 on MugshotMessages(sender-location) type rtree;
50create index msMessageIdx
51 on MugshotMessages(message) type keyword;