blob: f2b7c3569fbf664f3bb45160b4211f7ea9b93644 [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)
gstepanov15681d62015-02-23 17:17:50 +020035 name = db.Column(db.String(64), unique=True)
36 url = db.Column(db.String(256))
stgleb75c70412015-02-17 02:52:00 +020037 type = db.Column(db.String(4096))
gstepanov15681d62015-02-23 17:17:50 +020038 fuel_version = db.Column(db.String(64))
39 ceph_version = db.Column(db.String(64))
40 lab_general_info = db.Column(db.Text)
41 lab_meta = db.Column(db.Text)
stgleb75c70412015-02-17 02:52:00 +020042
43
44class Result(db.Model):
45 id = db.Column(db.Integer, primary_key=True)
46 build_id = db.Column(db.Integer, ForeignKey('build.id'))
gstepanov15681d62015-02-23 17:17:50 +020047 lab_id = db.Column(db.Integer, ForeignKey('lab.id'))
stgleb75c70412015-02-17 02:52:00 +020048 date = db.Column(db.DateTime)
49 param_combination_id = db.Column(db.Integer, ForeignKey('param_combination.id'))
50 bandwith = db.Column(db.Float)
51 meta = db.Column(db.String(4096))
52
53 def __repr__(self):
54 return str(self.bandwith) + " " + str(self.date)