20 lines
550 B
SQL
20 lines
550 B
SQL
-- +goose Up
|
|
-- +goose StatementBegin
|
|
CREATE TABLE IF NOT EXISTS opendtu_inverters_ac (
|
|
timestamp TIMESTAMPTZ,
|
|
-- FOREIGN KEY (timestamp) REFERENCES opendtu_log(timestamp),
|
|
inverter_serial TEXT,
|
|
ac_number INT,
|
|
power NUMERIC,
|
|
voltage NUMERIC,
|
|
current NUMERIC,
|
|
frequency NUMERIC,
|
|
powerfactor NUMERIC,
|
|
reactivepower NUMERIC
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS opendtu_inverters_ac_timestamp_idx ON opendtu_inverters_ac (timestamp);
|
|
-- +goose StatementEnd
|
|
-- +goose Down
|
|
-- +goose StatementBegin
|
|
-- +goose StatementEnd
|