Implement proper DB migrations using Goose. Upgrade go packages.
This commit is contained in:
parent
6902facab6
commit
444e5065a4
12 changed files with 255 additions and 117 deletions
22
migrations/00004_inverters_dc.sql
Normal file
22
migrations/00004_inverters_dc.sql
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- +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
|
Loading…
Add table
Add a link
Reference in a new issue