opendtu-logger/migrations/00004_inverters_dc.sql

23 lines
591 B
MySQL
Raw Normal View History

-- +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