Skip to content

Commit

Permalink
Merge pull request #5045 from weichou1229/reading-schema
Browse files Browse the repository at this point in the history
feat: Update reading table schema
  • Loading branch information
cloudxxx8 authored Jan 10, 2025
2 parents 0d11a11 + 4adb933 commit bbc21c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/core-data/res/db/sql/01-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS core_data.event (

-- core_data.reading is used to store the reading information
CREATE TABLE IF NOT EXISTS core_data.reading (
id UUID PRIMARY KEY,
id UUID,
event_id UUID,
devicename TEXT,
profilename TEXT,
Expand All @@ -32,3 +32,6 @@ CREATE TABLE IF NOT EXISTS core_data.reading (
FOREIGN KEY(event_id)
REFERENCES core_data.event(id)
);

CREATE UNIQUE INDEX IF NOT EXISTS idx_reading_id_origin
ON core_data.reading(id, origin) -- Using id and origin as index for TimescaleDB integration

0 comments on commit bbc21c9

Please sign in to comment.