stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 1 | from sqlalchemy import ForeignKey |
| 2 | from web_app.app import db |
| 3 | |
| 4 | |
| 5 | class 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 | |
| 16 | class 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 | |
| 23 | class 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()) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 28 | param_4 = db.Column(db.Text()) |
| 29 | param_5 = db.Column(db.Text()) |
| 30 | param_6 = db.Column(db.Text()) |
| 31 | param_7 = db.Column(db.Text()) |
| 32 | param_8 = db.Column(db.Text()) |
| 33 | param_9 = db.Column(db.Text()) |
| 34 | param_10 = db.Column(db.Text()) |
| 35 | param_11 = db.Column(db.Text()) |
| 36 | param_12 = db.Column(db.Text()) |
| 37 | param_13 = db.Column(db.Text()) |
| 38 | param_14 = db.Column(db.Text()) |
| 39 | param_15 = db.Column(db.Text()) |
| 40 | param_16 = db.Column(db.Text()) |
| 41 | param_17 = db.Column(db.Text()) |
| 42 | param_18 = db.Column(db.Text()) |
| 43 | param_19 = db.Column(db.Text()) |
| 44 | param_20 = db.Column(db.Text()) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 45 | |
| 46 | def __repr__(self): |
| 47 | return self.param_1 + " " + self.param_2 + " " + self.param_3 |
| 48 | |
| 49 | |
| 50 | class Lab(db.Model): |
| 51 | id = db.Column(db.Integer, primary_key=True) |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 52 | name = db.Column(db.String(64), unique=True) |
| 53 | url = db.Column(db.String(256)) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 54 | type = db.Column(db.String(4096)) |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 55 | fuel_version = db.Column(db.String(64)) |
| 56 | ceph_version = db.Column(db.String(64)) |
| 57 | lab_general_info = db.Column(db.Text) |
| 58 | lab_meta = db.Column(db.Text) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 59 | |
| 60 | |
| 61 | class Result(db.Model): |
| 62 | id = db.Column(db.Integer, primary_key=True) |
| 63 | build_id = db.Column(db.Integer, ForeignKey('build.id')) |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 64 | lab_id = db.Column(db.Integer, ForeignKey('lab.id')) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 65 | date = db.Column(db.DateTime) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 66 | param_combination_id = db.Column(db.Integer, |
| 67 | ForeignKey('param_combination.id')) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 68 | bandwith = db.Column(db.Float) |
| 69 | meta = db.Column(db.String(4096)) |
| 70 | |
| 71 | def __repr__(self): |
| 72 | return str(self.bandwith) + " " + str(self.date) |