blob: d09ed95b8c6773b97ae53e467cbe3903f86807c6 [file] [log] [blame]
stgleb75c70412015-02-17 02:52:00 +02001from sqlalchemy import ForeignKey
2from web_app.app import db
3
4
5class Build(db.Model):
6 id = db.Column(db.Integer, primary_key=True)
7 build_id = db.Column(db.String(64))
8 name = db.Column(db.String(64))
9 md5 = db.Column(db.String(64))
10 type = db.Column(db.Integer)
11
12 def __repr__(self):
13 return self.build_id + " " + self.name + " " + self.type
14
15
16class Param(db.Model):
17 id = db.Column(db.Integer, primary_key=True)
18 name = db.Column(db.String(64))
19 type = db.Column(db.String(64))
20 descr = db.Column(db.String(4096))
21
22
23class ParamCombination(db.Model):
24 id = db.Column(db.Integer, primary_key=True)
25 param_1 = db.Column(db.Text())
26 param_2 = db.Column(db.Text())
27 param_3 = db.Column(db.Text())
28
29 def __repr__(self):
30 return self.param_1 + " " + self.param_2 + " " + self.param_3
31
32
33class Lab(db.Model):
34 id = db.Column(db.Integer, primary_key=True)
35 name = db.Column(db.String(64))
36 type = db.Column(db.String(4096))
37
38
39class Result(db.Model):
40 id = db.Column(db.Integer, primary_key=True)
41 build_id = db.Column(db.Integer, ForeignKey('build.id'))
42 lab_id = db.Column(db.Integer)
43 date = db.Column(db.DateTime)
44 param_combination_id = db.Column(db.Integer, ForeignKey('param_combination.id'))
45 bandwith = db.Column(db.Float)
46 meta = db.Column(db.String(4096))
47
48 def __repr__(self):
49 return str(self.bandwith) + " " + str(self.date)