Compare commits
2 Commits
c8c7f63fdf
...
68c8099aaf
Author | SHA1 | Date | |
---|---|---|---|
68c8099aaf | |||
![]() |
16c24883ed |
@ -53,11 +53,7 @@ func connect() (*driver.Conn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Migrate() error {
|
func Migrate() error {
|
||||||
rows, err := Connection.Query(context.TODO(), "SELECT 1")
|
rows, err := Connection.Query(
|
||||||
if err != nil {
|
|
||||||
log.Fatal("Query failed:", err)
|
|
||||||
}
|
|
||||||
rows, err = Connection.Query(
|
|
||||||
context.TODO(),
|
context.TODO(),
|
||||||
`CREATE TABLE IF NOT EXISTS endpoints (
|
`CREATE TABLE IF NOT EXISTS endpoints (
|
||||||
timestamp DateTime,
|
timestamp DateTime,
|
||||||
@ -65,7 +61,7 @@ func Migrate() error {
|
|||||||
endpoint LowCardinality(String),
|
endpoint LowCardinality(String),
|
||||||
status_code UInt16,
|
status_code UInt16,
|
||||||
response_time_ms UInt32,
|
response_time_ms UInt32,
|
||||||
request_method LowCardinality(String),
|
request_method LowCardinality(String)
|
||||||
)
|
)
|
||||||
ENGINE = MergeTree
|
ENGINE = MergeTree
|
||||||
PARTITION BY toYYYYMM(timestamp)
|
PARTITION BY toYYYYMM(timestamp)
|
||||||
|
Loading…
Reference in New Issue
Block a user