opendtu-logger/migrations/00006_events.sql
Pieter Hollander 444e5065a4
All checks were successful
Build Docker image / build (push) Successful in 1m8s
Build Golang packages / release (push) Has been skipped
Implement proper DB migrations using Goose. Upgrade go packages.
2024-07-26 22:35:30 +02:00

17 lines
No EOL
421 B
SQL

-- +goose Up
-- +goose StatementBegin
CREATE TABLE IF NOT EXISTS opendtu_events (
-- id SERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
inverter_serial TEXT,
message_id INT,
message TEXT,
start_time INT,
end_time INT
);
CREATE INDEX IF NOT EXISTS opendtu_events_timestamp_idx ON opendtu_events (timestamp);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
-- +goose StatementEnd