This repository has been archived by the owner on Nov 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.xml
132 lines (110 loc) · 6.11 KB
/
schema.xml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<database name="tvheadend_status_manager" defaultIdMethod="native" namespace="Jalle19\StatusManager\Database">
<table name="instance" phpName="Instance">
<column name="name" type="varchar" size="255" required="true" primaryKey="true"/>
</table>
<table name="user" phpName="User">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="instance_name" type="varchar" size="255" required="true"/>
<column name="name" type="varchar" size="255" required="true"/>
<foreign-key foreignTable="instance" phpName="Instance" refPhpName="User">
<reference local="instance_name" foreign="name"/>
</foreign-key>
<index name="user_instance_name_name">
<index-column name="instance_name"/>
<index-column name="name"/>
</index>
</table>
<table name="connection" phpName="Connection">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="instance_name" type="varchar" size="255" required="true"/>
<!-- ticket subscriptions produce connections without a user -->
<column name="user_id" type="integer" defaultValue="NULL"/>
<column name="peer" type="varchar" size="255" required="true"/>
<column name="started" type="timestamp" required="true"/>
<column name="type" type="varchar" size="255" required="true"/>
<foreign-key foreignTable="instance" phpName="Instance" refPhpName="Connection">
<reference local="instance_name" foreign="name"/>
</foreign-key>
<foreign-key foreignTable="user" phpName="User" refPhpName="Connection">
<reference local="user_id" foreign="id"/>
</foreign-key>
<index name="connection_instance_name_peer_started">
<index-column name="instance_name"/>
<index-column name="peer"/>
<index-column name="started"/>
</index>
</table>
<table name="input" phpName="Input">
<column name="uuid" type="varchar" size="255" primaryKey="true"/>
<column name="instance_name" type="varchar" size="255" required="true"/>
<column name="started" type="timestamp" required="true"/>
<column name="input" type="varchar" size="255" required="true"/>
<column name="network" type="varchar" size="255" required="true"/>
<column name="mux" type="varchar" size="255" required="true"/>
<column name="weight" type="integer" required="true"/>
<foreign-key foreignTable="instance" phpName="Instance" refPhpName="Input">
<reference local="instance_name" foreign="name"/>
</foreign-key>
</table>
<table name="input_error" phpName="InputError">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="input_uuid" type="varchar" size="255" required="true"/>
<column name="ber_average" type="double" required="true"/>
<column name="unc_average" type="double" required="true"/>
<column name="cumulative_te" type="integer" required="true"/>
<column name="cumulative_cc" type="integer" required="true"/>
<behavior name="timestampable">
<parameter name="create_column" value="created"/>
<parameter name="update_column" value="modified"/>
</behavior>
<foreign-key foreignTable="input" phpName="Input">
<reference local="input_uuid" foreign="uuid"/>
</foreign-key>
</table>
<table name="channel" phpName="Channel">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="instance_name" type="varchar" size="255" required="true"/>
<column name="name" type="varchar" size="255" required="true"/>
<foreign-key foreignTable="instance" phpName="Instance" refPhpName="Channel">
<reference local="instance_name" foreign="name"/>
</foreign-key>
<index name="channel_instance_name_name">
<index-column name="instance_name"/>
<index-column name="name"/>
</index>
</table>
<table name="subscription" phpName="Subscription">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="instance_name" type="varchar" size="255" required="true"/>
<!-- we cannot always tie a subscription to an input due to an API limitation -->
<column name="input_uuid" type="varchar" size="255"/>
<!-- ticket subscriptions don't have a user -->
<column name="user_id" type="integer" defaultValue="NULL"/>
<column name="channel_id" type="integer" required="true"/>
<column name="subscription_id" type="integer" required="true"/>
<column name="started" type="timestamp" required="true"/>
<column name="stopped" type="timestamp" defaultVaue="NULL"/>
<column name="title" type="varchar" size="255" required="true"/>
<column name="service" type="varchar" size="255" defaultValue="NULL"/>
<foreign-key foreignTable="instance" phpName="Instance" refPhpName="Subscription">
<reference local="instance_name" foreign="name"/>
</foreign-key>
<foreign-key foreignTable="input" phpName="Input" refPhpName="Subscription">
<reference local="input_uuid" foreign="uuid"/>
</foreign-key>
<foreign-key foreignTable="user" phpName="User" refPhpName="Subscription">
<reference local="user_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="channel" phpName="Channel" refPhpName="Subscription">
<reference local="channel_id" foreign="id"/>
</foreign-key>
<index name="subscription_instance_name_user_id_channel_id_subscription_id_started">
<index-column name="instance_name"/>
<index-column name="user_id"/>
<index-column name="channel_id"/>
<index-column name="subscription_id"/>
<index-column name="started"/>
</index>
</table>
</database>