forked from edgexfoundry/edgex-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-tables.sql
34 lines (32 loc) · 801 Bytes
/
01-tables.sql
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
--
-- Copyright (C) 2024 IOTech Ltd
--
-- SPDX-License-Identifier: Apache-2.0
-- core_data.event is used to store the event information
CREATE TABLE IF NOT EXISTS core_data.event (
id UUID PRIMARY KEY,
devicename TEXT,
profilename TEXT,
sourcename TEXT,
origin BIGINT,
tags JSONB
);
-- core_data.reading is used to store the reading information
CREATE TABLE IF NOT EXISTS core_data.reading (
id UUID PRIMARY KEY,
event_id UUID,
devicename TEXT,
profilename TEXT,
resourcename TEXT,
origin BIGINT,
valuetype TEXT DEFAULT '',
units TEXT DEFAULT '',
tags JSONB,
value TEXT,
mediatype TEXT,
binaryvalue BYTEA,
objectvalue JSONB,
CONSTRAINT fk_event
FOREIGN KEY(event_id)
REFERENCES core_data.event(id)
);