-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOpenEnv.dbs
160 lines (160 loc) · 8.62 KB
/
OpenEnv.dbs
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="UTF-8" ?>
<project name="OpenEnv" id="Project_2929eb5" template="Default" database="PostgreSQL" >
<schema name="openenv" >
<table name="account" >
<comment><![CDATA[A users account details]]></comment>
<column name="account_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="first_name" type="varchar" length="100" jt="12" />
<column name="last_name" type="varchar" length="100" jt="12" />
<column name="email" type="varchar" length="256" jt="12" />
<column name="sign_up_date" type="timestamptz" jt="93" />
<column name="account_password" type="varchar" length="256" decimal="0" jt="12" />
<column name="modified_timestamp" type="timestamp" length="29" decimal="6" jt="93" />
<index name="pk_account_account_id" unique="PRIMARY_KEY" >
<column name="account_id" />
</index>
<fk name="fk_account_station" virtual="y" to_schema="openenv" to_table="station" >
<fk_column name="account_id" pk="account_id" />
</fk>
</table>
<table name="api_key" >
<column name="api_key_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="account_id" type="integer" jt="4" />
<column name="api_key" type="varchar" length="256" jt="12" />
<column name="api_key_created" type="timestamptz" jt="93" />
<column name="station_id" type="integer" jt="4" />
<column name="key_type_id" type="integer" jt="4" />
<index name="pk_account_api_key_api_key_id" unique="PRIMARY_KEY" >
<column name="api_key_id" />
</index>
<fk name="fk_account_api_key_account" virtual="y" to_schema="openenv" to_table="account" >
<fk_column name="account_id" pk="account_id" />
</fk>
</table>
<table name="key_types" >
<column name="key_type_id" type="integer" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="name" type="varchar" length="100" jt="12" />
<column name="description" type="text" jt="12" />
<index name="pk_key_types_key_types_id" unique="PRIMARY_KEY" >
<column name="key_type_id" />
</index>
<fk name="fk_key_types_api_key" virtual="y" to_schema="openenv" to_table="api_key" >
<fk_column name="key_type_id" pk="key_type_id" />
</fk>
</table>
<table name="measurement" >
<comment><![CDATA[The primary table for this platform. It will store all the raw data results for the OpenEnv system]]></comment>
<column name="measurement_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="direction" type="numeric" length="20" decimal="6" jt="2" >
<comment><![CDATA[for a vector quantity, this is the bearing, i.e. wind direction]]></comment>
</column>
<column name="measurement_type_id" type="integer" length="10" decimal="0" jt="4" />
<column name="latitude" type="numeric" length="12" decimal="6" jt="2" />
<column name="longitude" type="numeric" length="12" decimal="6" jt="2" />
<column name="measurement_datetime" type="timestamptz" length="35" decimal="6" jt="93" />
<column name="station_id" type="integer" length="10" decimal="0" jt="4" />
<column name="measurement_value" type="numeric" length="12" decimal="6" jt="2" />
<index name="measurement_pkey" unique="PRIMARY_KEY" >
<column name="measurement_id" />
</index>
<fk name="fk_measurement_measurement_type" virtual="y" to_schema="openenv" to_table="measurement_type" >
<fk_column name="measurement_type_id" pk="measurement_type_id" />
</fk>
</table>
<table name="measurement_type" >
<column name="measurement_type_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="measurement_type" type="varchar" length="255" jt="12" >
<comment><![CDATA[The title of the measurement, i.e. temperature]]></comment>
</column>
<column name="units" type="varchar" length="255" jt="12" >
<comment><![CDATA[What are the units that this measurement is measured in, i.e. degrees c]]></comment>
</column>
<column name="description" type="text" jt="12" />
<column name="effective_from" type="timestamptz" jt="93" >
<comment><![CDATA[UTC date the record was effective from]]></comment>
</column>
<column name="effective_to" type="timestamptz" jt="93" >
<comment><![CDATA[UTC effective to date of the record, NULL if record is still effective]]></comment>
</column>
<index name="pk_measurement_type_measurement_type_id" unique="PRIMARY_KEY" >
<column name="measurement_type_id" />
</index>
</table>
<table name="station" >
<comment><![CDATA[This is the station that recorded the measurement]]></comment>
<column name="station_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="account_id" type="integer" jt="4" />
<column name="station_type_id" type="integer" jt="4" />
<index name="pk_station_station_id" unique="PRIMARY_KEY" >
<column name="station_id" />
</index>
<fk name="fk_station_measurement" virtual="y" to_schema="openenv" to_table="measurement" >
<fk_column name="station_id" pk="station_id" />
</fk>
<fk name="fk_station_account_api_key" virtual="y" to_schema="openenv" to_table="api_key" >
<fk_column name="station_id" pk="station_id" />
</fk>
</table>
<table name="station_location" >
<comment><![CDATA[measurements of the stations location]]></comment>
<column name="station_location_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="station_id" type="integer" jt="4" />
<column name="latitude" type="numeric" length="12" decimal="6" jt="2" />
<column name="longitude" type="numeric" length="12" decimal="6" jt="2" />
<column name="effective_from_date" type="timestamptz" jt="93" />
<column name="effective_to_date" type="timestamptz" jt="93" />
<index name="pk_station_location_station_location_id" unique="PRIMARY_KEY" >
<column name="station_location_id" />
</index>
<fk name="fk_station_location_station" virtual="y" to_schema="openenv" to_table="station" >
<fk_column name="station_id" pk="station_id" />
</fk>
</table>
<table name="station_type" >
<column name="station_type_id" type="integer" length="10" decimal="0" jt="4" mandatory="y" >
<type_extra>GENERATED BY DEFAULT AS IDENTITY</type_extra>
</column>
<column name="type_label" type="varchar" length="126" jt="12" />
<column name="description" type="varchar" length="500" jt="12" />
<index name="pk_station_type_station_type_id" unique="PRIMARY_KEY" >
<column name="station_type_id" />
</index>
<fk name="fk_station_type_station" virtual="y" to_schema="openenv" to_table="station" >
<fk_column name="station_type_id" pk="station_type_id" />
</fk>
</table>
<sequence name="account_account_id_seq" options="START WITH 1" />
<sequence name="account_api_key_api_key_id_seq" options="START WITH 1" />
<sequence name="measurement_id_seq" options="START WITH 1" />
<sequence name="measurement_measurement_id_seq" options="START WITH 1" />
<sequence name="measurement_type_measurement_type_id_seq" options="START WITH 1" />
<sequence name="station_location_station_location_id_seq" options="START WITH 1" />
<sequence name="station_station_id_seq" options="START WITH 1" />
<sequence name="station_type_station_type_id_seq" options="START WITH 1" />
</schema>
<connector name="OpenEnv" database="PostgreSQL" driver_class="org.postgresql.Driver" driver_jar="postgresql-42.2.8.jar" driver_desc="Heroku" host="opengeo.cigcika7szfc.ap-southeast-2.rds.amazonaws.com" port="5432" instance="openenv" user="postgres" passwd="SmFtZXMwNyo=" />
<layout name="Default Layout" id="Layout_5f3cc23" show_relation="columns" >
<entity schema="openenv" name="station_type" color="C1D8EE" x="48" y="400" />
<entity schema="openenv" name="measurement" color="3986C1" x="112" y="48" />
<entity schema="openenv" name="measurement_type" color="C1D8EE" x="352" y="48" />
<entity schema="openenv" name="station" color="C1D8EE" x="192" y="288" />
<entity schema="openenv" name="station_location" color="C1D8EE" x="560" y="64" />
<entity schema="openenv" name="key_types" color="C1D8EE" x="656" y="544" />
<entity schema="openenv" name="api_key" color="C1D8EE" x="560" y="352" />
<entity schema="openenv" name="account" color="C1D8EE" x="288" y="432" />
</layout>
</project>