forked from GeraldWodni/theforth.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.js
38 lines (33 loc) · 1.17 KB
/
data.js
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
module.exports = {
setup: function _setup( k ) {
var db = k.getDb();
var users = k.crud.sql( db, { table: "users", key: "id", foreignName: "name",
wheres: {
"name": { where: "`name`=?" }
}
} );
var legacyUsers = k.crud.sql( db, { table: "openidUsers", key: "uin", foreignName: "name",
wheres: {
"link": { where: "`link`=?" }
}
} );
var tags = k.crud.sql( db, { table: "tagNames", key: "id", foreignName: "name",
wheres: {
"name": { where: "`name`=?" }
}
} );
var packages = k.crud.sql( db, { table: "packages", key: "id", foreignName: "name",
wheres: {
"name": { where: "`name`=?" },
"search": { where: "`name` LIKE CONCAT('%',?,'%') OR `description` LIKE CONCAT('%',?,'%')" },
"user": { where: "`user`=?" }
}
} );
return {
legacyUsers: legacyUsers,
packages: packages,
tags: tags,
users: users
};
}
}