From 108564ff7ccb0de889f1297763aa146fc08b6fcd Mon Sep 17 00:00:00 2001 From: majabirmancevic Date: Mon, 30 Sep 2024 17:16:39 +0200 Subject: [PATCH] Fix the indentation --- consumers/writers/postgres/init.go | 42 +++++++++++++-------------- consumers/writers/timescale/init.go | 44 ++++++++++++++--------------- readers/postgres/init.go | 16 +++++------ readers/timescale/init.go | 44 ++++++++++++++--------------- 4 files changed, 73 insertions(+), 73 deletions(-) diff --git a/consumers/writers/postgres/init.go b/consumers/writers/postgres/init.go index 248631bbd..53cd92ab0 100644 --- a/consumers/writers/postgres/init.go +++ b/consumers/writers/postgres/init.go @@ -49,28 +49,28 @@ func migrateDB(db *sqlx.DB) error { Id: "messages_1", Up: []string{ `CREATE TABLE IF NOT EXISTS messages ( - subtopic VARCHAR(254), - publisher UUID, - protocol TEXT, - name TEXT, - unit TEXT, - value FLOAT, - string_value TEXT, - bool_value BOOL, - data_value BYTEA, - sum FLOAT, - time FLOAT, - update_time FLOAT, - PRIMARY KEY (time, publisher, subtopic, name) - )`, + subtopic VARCHAR(254), + publisher UUID, + protocol TEXT, + name TEXT, + unit TEXT, + value FLOAT, + string_value TEXT, + bool_value BOOL, + data_value BYTEA, + sum FLOAT, + time FLOAT, + update_time FLOAT, + PRIMARY KEY (time, publisher, subtopic, name) + )`, `CREATE TABLE IF NOT EXISTS json ( - created BIGINT, - subtopic VARCHAR(254), - publisher VARCHAR(254), - protocol TEXT, - payload JSONB, - PRIMARY KEY (publisher, subtopic, created) - )`, + created BIGINT, + subtopic VARCHAR(254), + publisher VARCHAR(254), + protocol TEXT, + payload JSONB, + PRIMARY KEY (publisher, subtopic, created) + )`, }, Down: []string{ "DROP TABLE messages", diff --git a/consumers/writers/timescale/init.go b/consumers/writers/timescale/init.go index 55bdaf451..985b1aeca 100644 --- a/consumers/writers/timescale/init.go +++ b/consumers/writers/timescale/init.go @@ -49,29 +49,29 @@ func migrateDB(db *sqlx.DB) error { Id: "messages_1", Up: []string{ `CREATE TABLE IF NOT EXISTS messages ( - time BIGINT NOT NULL, - subtopic VARCHAR(254), - publisher UUID, - protocol TEXT, - name VARCHAR(254), - unit TEXT, - value FLOAT, - string_value TEXT, - bool_value BOOL, - data_value BYTEA, - sum FLOAT, - update_time FLOAT, - PRIMARY KEY (time, publisher, subtopic, name) - ); - SELECT create_hypertable('messages', 'time', create_default_indexes => FALSE, chunk_time_interval => 86400000, if_not_exists => TRUE);`, + time BIGINT NOT NULL, + subtopic VARCHAR(254), + publisher UUID, + protocol TEXT, + name VARCHAR(254), + unit TEXT, + value FLOAT, + string_value TEXT, + bool_value BOOL, + data_value BYTEA, + sum FLOAT, + update_time FLOAT, + PRIMARY KEY (time, publisher, subtopic, name) + ); + SELECT create_hypertable('messages', 'time', create_default_indexes => FALSE, chunk_time_interval => 86400000, if_not_exists => TRUE);`, `CREATE TABLE IF NOT EXISTS json ( - created BIGINT, - subtopic VARCHAR(254), - publisher VARCHAR(254), - protocol TEXT, - payload JSONB, - PRIMARY KEY (publisher, subtopic, created) - )`, + created BIGINT, + subtopic VARCHAR(254), + publisher VARCHAR(254), + protocol TEXT, + payload JSONB, + PRIMARY KEY (publisher, subtopic, created) + )`, }, Down: []string{ "DROP TABLE messages", diff --git a/readers/postgres/init.go b/readers/postgres/init.go index 47c5c0425..28e97b43a 100644 --- a/readers/postgres/init.go +++ b/readers/postgres/init.go @@ -61,16 +61,16 @@ func migrateDB(db *sqlx.DB) error { sum FLOAT, time FlOAT, update_time FLOAT, - PRIMARY KEY (time, publisher, subtopic, name) + PRIMARY KEY (time, publisher, subtopic, name) )`, `CREATE TABLE IF NOT EXISTS json ( - created BIGINT, - subtopic VARCHAR(254), - publisher VARCHAR(254), - protocol TEXT, - payload JSONB, - PRIMARY KEY (publisher, subtopic, created) - )`, + created BIGINT, + subtopic VARCHAR(254), + publisher VARCHAR(254), + protocol TEXT, + payload JSONB, + PRIMARY KEY (publisher, subtopic, created) + )`, }, Down: []string{ "DROP TABLE messages", diff --git a/readers/timescale/init.go b/readers/timescale/init.go index 55bdaf451..985b1aeca 100644 --- a/readers/timescale/init.go +++ b/readers/timescale/init.go @@ -49,29 +49,29 @@ func migrateDB(db *sqlx.DB) error { Id: "messages_1", Up: []string{ `CREATE TABLE IF NOT EXISTS messages ( - time BIGINT NOT NULL, - subtopic VARCHAR(254), - publisher UUID, - protocol TEXT, - name VARCHAR(254), - unit TEXT, - value FLOAT, - string_value TEXT, - bool_value BOOL, - data_value BYTEA, - sum FLOAT, - update_time FLOAT, - PRIMARY KEY (time, publisher, subtopic, name) - ); - SELECT create_hypertable('messages', 'time', create_default_indexes => FALSE, chunk_time_interval => 86400000, if_not_exists => TRUE);`, + time BIGINT NOT NULL, + subtopic VARCHAR(254), + publisher UUID, + protocol TEXT, + name VARCHAR(254), + unit TEXT, + value FLOAT, + string_value TEXT, + bool_value BOOL, + data_value BYTEA, + sum FLOAT, + update_time FLOAT, + PRIMARY KEY (time, publisher, subtopic, name) + ); + SELECT create_hypertable('messages', 'time', create_default_indexes => FALSE, chunk_time_interval => 86400000, if_not_exists => TRUE);`, `CREATE TABLE IF NOT EXISTS json ( - created BIGINT, - subtopic VARCHAR(254), - publisher VARCHAR(254), - protocol TEXT, - payload JSONB, - PRIMARY KEY (publisher, subtopic, created) - )`, + created BIGINT, + subtopic VARCHAR(254), + publisher VARCHAR(254), + protocol TEXT, + payload JSONB, + PRIMARY KEY (publisher, subtopic, created) + )`, }, Down: []string{ "DROP TABLE messages",