-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
46 lines (44 loc) · 1.05 KB
/
models.py
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
from sqlalchemy import (
create_engine,
MetaData,
Table,
Column,
Integer,
String,
Float,
ForeignKey
)
meta = MetaData()
link = Table(
'link', meta,
Column('id', Integer, primary_key=True),
Column('link', String),
Column(
'device_id',
Integer,
ForeignKey('device.id')
)
)
device = Table(
'device', meta,
Column('id', Integer, primary_key=True),
Column('query', String),
Column('mttr', Float),
Column('mtbf', Float),
Column('failure_rate', Float),
Column('failure_rate_in_storage_mode', Float),
Column('storage_time', Float),
Column('minimal_resource', Float),
Column('gamma_percentage_resource', Float),
Column('average_resource', Float),
Column('average_lifetime', Float),
Column('recovery_intensity', Float),
Column('system_reliability', Float),
Column('score', Integer)
)
if __name__ == '__main__':
engine = create_engine(
'postgresql://postgres:docker@postgres:5432',
echo = True
)
meta.create_all(engine)