blob: 87ad2b02b17dfd6f2115b3e848e8e94c252a6fe3 [file] [log] [blame]
Ian Maxon857dc132015-09-25 17:13:19 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Till Westmannfd733ee2014-07-10 00:57:37 -070019drop dataverse TinySocial if exists;
20create dataverse TinySocial;
21use dataverse TinySocial;
22
23create type EmploymentType as open {
24 organization-name: string,
25 start-date: date,
26 end-date: date?
27}
28
29create type MugshotUserType as {
30 id: int32,
31 alias: string,
32 name: string,
33 user-since: datetime,
34 address: {
35 street: string,
36 city: string,
37 state: string,
38 zip: string,
39 country: string
40 },
41 friend-ids: {{ int32 }},
42 employment: [EmploymentType]
43}
44
45create type MugshotMessageType as closed {
46 message-id: int32,
47 author-id: int32,
48 timestamp: datetime,
49 in-response-to: int32?,
50 sender-location: point?,
51 tags: {{ string }},
52 message: string
53}
54
55create dataset MugshotUsers(MugshotUserType)
56 primary key id;
57create dataset MugshotMessages(MugshotMessageType)
58 primary key message-id;
59
60create index msUserSinceIdx
61 on MugshotUsers(user-since);
62create index msTimestampIdx
63 on MugshotMessages(timestamp);
64create index msAuthorIdx
65 on MugshotMessages(author-id) type btree;
66create index msSenderLocIndex
67 on MugshotMessages(sender-location) type rtree;
68create index msMessageIdx
69 on MugshotMessages(message) type keyword;