Skip to content

Commit 050472a

Browse files
committed
Fix bug with column name.
1 parent 1c9a25e commit 050472a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/database/mariadb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func (m *MariaDB) SaveSchema(ctx context.Context, sourceName string, schema sche
529529
return fmt.Errorf("Unable to json encode schema: %v", err)
530530
}
531531

532-
_, err = m.db.ExecContext(ctx, "INSERT INTO graph_schema (source_name, graph, timestamp) VALUES (?, ?, CURRENT_TIMESTAMP())",
532+
_, err = m.db.ExecContext(ctx, "INSERT INTO graph_schema (importer, graph, timestamp) VALUES (?, ?, CURRENT_TIMESTAMP())",
533533
sourceName, string(b))
534534
if err != nil {
535535
return fmt.Errorf("Unable to save schema in DB: %v", err)
@@ -540,7 +540,7 @@ func (m *MariaDB) SaveSchema(ctx context.Context, sourceName string, schema sche
540540

541541
// LoadSchema load the schema graph of the source from DB
542542
func (m *MariaDB) LoadSchema(ctx context.Context, sourceName string) (schema.SchemaGraph, error) {
543-
row := m.db.QueryRowContext(ctx, "SELECT graph FROM graph_schema WHERE source_name = ? ORDER BY id DESC LIMIT 1", sourceName)
543+
row := m.db.QueryRowContext(ctx, "SELECT graph FROM graph_schema WHERE importer = ? ORDER BY id DESC LIMIT 1", sourceName)
544544
var rawJSON string
545545
if err := row.Scan(&rawJSON); err != nil {
546546
if err == sql.ErrNoRows {

0 commit comments

Comments
 (0)