Skip to content

Commit

Permalink
Merge branch 'master' into aku/binaryVersioning
Browse files Browse the repository at this point in the history
  • Loading branch information
kuannie1 authored Oct 28, 2019
2 parents 4a07fe2 + aa71740 commit e2ec5a7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/resources/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func CreateView(data *schema.ResourceData, meta interface{}) error {
builder.WithComment(v.(string))
}

if v, ok := data.GetOk("schema"); ok {
builder.WithSchema(v.(string))
}

q := builder.Create()

err := DBExec(db, q)
Expand Down Expand Up @@ -130,6 +134,11 @@ func ReadView(data *schema.ResourceData, meta interface{}) error {
return err
}

err = data.Set("schema", schemaName.String)
if err != nil {
return err
}

// #HACK(adoami): Want to only capture the Select part of the query because before that is the Create part of the view which we no longer care about
space := regexp.MustCompile(`\s+`)
cleanString := space.ReplaceAllString(text.String, " ")
Expand Down

0 comments on commit e2ec5a7

Please sign in to comment.