opendtu-logger/migrations/00004_inverters_dc.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

22 lines
591 B
SQL

-- +goose Up
-- +goose StatementBegin
CREATE TABLE IF NOT EXISTS opendtu_inverters_dc (
-- id SERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ,
-- FOREIGN KEY (timestamp) REFERENCES opendtu_log(timestamp),
inverter_serial TEXT,
dc_number INT,
name TEXT,
power NUMERIC,
voltage NUMERIC,
current NUMERIC,
yieldday NUMERIC,
yieldtotal NUMERIC,
irradiation NUMERIC
);
CREATE INDEX IF NOT EXISTS opendtu_inverters_dc_timestamp_idx ON opendtu_inverters_dc (timestamp);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
-- +goose StatementEnd