Skip to content

Commit 777b31d

Browse files
committed
Track table: source is the db name
1 parent 4cbdb69 commit 777b31d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hasura/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ func (api *API) ReplaceMetadata(data *Metadata) error {
138138
}
139139

140140
// TrackTable -
141-
func (api *API) TrackTable(schema, name string) error {
141+
func (api *API) TrackTable(source, name string) error {
142142
req := request{
143143
Type: "pg_track_table",
144144
Args: map[string]string{
145-
"source": schema,
145+
"source": source,
146146
"table": name,
147147
},
148148
}

hasura/hasura.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func Create(hasura config.Hasura, cfg config.Database, views []string, models ..
7474

7575
log.Info("Tracking views...")
7676
for i := range views {
77-
if err := api.TrackTable("public", views[i]); err != nil {
77+
if err := api.TrackTable(cfg.Database, views[i]); err != nil {
7878
if !strings.Contains(err.Error(), "view/table already tracked") {
7979
return err
8080
}

0 commit comments

Comments
 (0)