Renamed generated SetSchema to Set<SchemaName>Schema

This commit is contained in:
Jay 2022-12-01 12:46:42 +05:30
parent 471499ea00
commit a792fe6e0a
3 changed files with 33 additions and 7 deletions

View file

@ -7,10 +7,11 @@ import (
"strconv"
"testing"
"github.com/stretchr/testify/require"
"github.com/go-jet/jet/v2/generator/mysql"
"github.com/go-jet/jet/v2/internal/testutils"
"github.com/go-jet/jet/v2/tests/dbconfig"
"github.com/stretchr/testify/require"
)
const genTestDirRoot = "./.gentestdata3"
@ -307,6 +308,25 @@ func newActorTableImpl(schemaName, tableName, alias string) actorTable {
MutableColumns: mutableColumns,
}
}
func SetDvdsSchema(schema string) {
Actor = Actor.FromSchema(schema)
Address = Address.FromSchema(schema)
Category = Category.FromSchema(schema)
City = City.FromSchema(schema)
Country = Country.FromSchema(schema)
Customer = Customer.FromSchema(schema)
Film = Film.FromSchema(schema)
FilmActor = FilmActor.FromSchema(schema)
FilmCategory = FilmCategory.FromSchema(schema)
FilmText = FilmText.FromSchema(schema)
Inventory = Inventory.FromSchema(schema)
Language = Language.FromSchema(schema)
Payment = Payment.FromSchema(schema)
Rental = Rental.FromSchema(schema)
Staff = Staff.FromSchema(schema)
Store = Store.FromSchema(schema)
}
`
var actorModelFile = `