Skip to content

Commit

Permalink
Merge pull request #79 from wepala/WEOS-1328
Browse files Browse the repository at this point in the history
feature/Weos 1328: Refactor Migrate function
  • Loading branch information
shaniah868 authored Feb 4, 2022
2 parents d82e22b + cbc575f commit 715affd
Show file tree
Hide file tree
Showing 22 changed files with 2,480 additions and 360 deletions.
15 changes: 8 additions & 7 deletions controllers/rest/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import (
"database/sql"
"errors"
"fmt"
"net/http"
"os"
"reflect"
"strconv"
"strings"
"time"

weoscontext "github.com/wepala/weos/context"
"github.com/wepala/weos/projections/dialects"
"gorm.io/driver/clickhouse"
Expand All @@ -13,12 +20,6 @@ import (
"gorm.io/driver/sqlite"
"gorm.io/driver/sqlserver"
"gorm.io/gorm"
"net/http"
"os"
"reflect"
"strconv"
"strings"
"time"

"github.com/getkin/kin-openapi/openapi3"
"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -301,7 +302,7 @@ func (p *RESTAPI) Initialize(ctxt context.Context) error {
//get the database schema
schemas = CreateSchema(ctxt, p.EchoInstance(), p.Swagger)
p.Schemas = schemas
err = defaultProjection.Migrate(ctxt, schemas)
err = defaultProjection.Migrate(ctxt, schemas, p.Swagger.Components.Schemas)
if err != nil {
p.EchoInstance().Logger.Error(err)
return err
Expand Down
Loading

0 comments on commit 715affd

Please sign in to comment.