diff --git a/run/convert.go b/run/convert.go index 54e4e90..cfce2e1 100644 --- a/run/convert.go +++ b/run/convert.go @@ -41,6 +41,9 @@ func makeData(log *log.Logger, info *database.Info, cfg *Config) (*data.DBData, enum := &data.Enum{ DBName: e.Name, Schema: sch, + Table: &data.Table{ + DBName: e.Table, + }, } sch.Enums = append(sch.Enums, enum) enum.Name, err = convert(e.Name) diff --git a/run/generate.go b/run/generate.go index 6ee4b4a..67d7b28 100644 --- a/run/generate.go +++ b/run/generate.go @@ -74,7 +74,7 @@ func generateSchemas(env environ.Values, cfg *Config, db *data.DBData) error { func generateEnums(env environ.Values, cfg *Config, db *data.DBData) error { for _, schema := range db.Schemas { for _, enum := range schema.Enums { - fileData := struct{ Schema, Enum string }{Schema: schema.Name, Enum: enum.Name} + fileData := struct{ Schema, Enum, Table string }{Schema: schema.Name, Enum: enum.Name, Table: enum.Table.DBName} contents := data.EnumData{ Enum: enum, DB: db,