diff --git a/db_changes/db/db.go b/db_changes/db/db.go index 40eb364..b02eca1 100644 --- a/db_changes/db/db.go +++ b/db_changes/db/db.go @@ -173,6 +173,16 @@ func (l *Loader) getTablesFromSchema(schemaName string) (map[[2]string][]*sql.Co ORDER BY table_schema, table_name ` + if l.dsn.Driver() == "clickhouse" { + query = ` + SELECT database AS table_schema, name AS table_name + FROM system.tables + WHERE database = ? + AND engine NOT IN ('View', 'MaterializedView', 'Buffer') + ORDER BY table_schema, table_name + ` + } + rows, err := l.DB.Query(query, schemaName) if err != nil { return nil, fmt.Errorf("querying tables: %w", err) diff --git a/db_changes/db/dsn.go b/db_changes/db/dsn.go index 20edaf4..ed0764a 100644 --- a/db_changes/db/dsn.go +++ b/db_changes/db/dsn.go @@ -113,10 +113,6 @@ func (c *DSN) ConnString() string { // In the old code, of there was options set and the host was localhost, we were switching // to host 127.0.0.1 + change of scheme to http/https, let's keep that for now host = "127.0.0.1" - scheme = "http" - if c.Options.Get("secure") == "true" { - scheme = "https" - } } baseURL := fmt.Sprintf("%s://%s:%s@%s:%d/%s", scheme, c.Username, c.Password, host, c.Port, c.Database)