-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_show.js
66 lines (64 loc) · 2.16 KB
/
init_show.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
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
// Generated by CoffeeScript 1.9.3
(function() {
module.exports = function(db) {
var Contest, ContestProblemList, Group, Issue, IssueReply, Judge, Membership, Message, Problem, Submission, SubmissionCode, User, testContest, testGroup, testProblem, testUser;
Contest = db.models.contest;
ContestProblemList = db.models.contest_problem_list;
Group = db.models.group;
Judge = db.models.judge;
Membership = db.models.membership;
Problem = db.models.problem;
Submission = db.models.submission;
SubmissionCode = db.models.submission_code;
User = db.models.user;
Message = db.models.message;
Issue = db.models.issue;
IssueReply = db.models.issue_reply;
testUser = void 0;
testGroup = void 0;
testContest = void 0;
testProblem = void 0;
return db.Promise.resolve().then(function() {
return User.create({
username: "[email protected]",
password: 'sha1$32f5d6c9$1$c84e8c6ed82e32549513da9444d940599ad30b96',
nickname: 'test'
});
}).then(function(user) {
testUser = user;
return Group.create({
name: 'C++程序设计',
description: '一门重要的课',
access_level: 'protect'
});
}).then(function(group) {
testGroup = group;
return group.setCreator(testUser);
}).then(function(group) {
return group.addUser(testUser, {
access_level: 'owner'
});
}).then(function() {
return Contest.create({
title: "实验室摸你赛 第一场",
access_level: 'public',
description: '这是一个public的比赛,谁都可以参加',
start_time: new Date("2015-09-10 10:00"),
end_time: new Date("2015-09-14 10:00")
});
}).then(function(contest) {
return db.Promise.all([
testUser.addContest(contest), testGroup.addContest(contest), Judge.create({
name: "Judge1",
secret_key: "沛神太帅了"
}), Judge.create({
name: "Judge2",
secret_key: "梁明阳专用judge"
})
]);
}).then(function() {
return console.log("Init completed!");
});
};
}).call(this);
//# sourceMappingURL=init_show.js.map