Skip to content

Commit

Permalink
Fix the indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
majabirmancevic committed Sep 30, 2024
1 parent 399692d commit 108564f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 73 deletions.
42 changes: 21 additions & 21 deletions consumers/writers/postgres/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
44 changes: 22 additions & 22 deletions consumers/writers/timescale/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions readers/postgres/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
44 changes: 22 additions & 22 deletions readers/timescale/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 108564f

Please sign in to comment.