Skip to content

Commit

Permalink
Merge pull request #387 from safaci2000/feature/enums
Browse files Browse the repository at this point in the history
Adding support for enum model AllValues
  • Loading branch information
go-jet authored Sep 23, 2024
2 parents 1c42ff1 + d3ce39f commit 6a0798e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions generator/template/file_templates.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tests/postgres/generator_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func TestGeneratorTemplate_Model_RenameFilesAndTypes(t *testing.T) {

mpaaRating := file2.Exists(t, defaultModelPath, "mpaa_rating_enum.go")
require.Contains(t, mpaaRating, "type MpaaRatingEnum string")
require.Contains(t, mpaaRating, "MpaaRatingEnumAllValues")
}

func TestGeneratorTemplate_Model_SkipTableAndEnum(t *testing.T) {
Expand Down Expand Up @@ -268,7 +269,6 @@ func UseSchema(schema string) {
FilmList = FilmList.FromSchema(schema)
}
`)

}

func TestGeneratorTemplate_SQLBuilder_ChangeTypeAndFileName(t *testing.T) {
Expand Down Expand Up @@ -366,7 +366,6 @@ func TestGeneratorTemplate_SQLBuilder_DefaultAlias(t *testing.T) {
}

func TestGeneratorTemplate_Model_AddTags(t *testing.T) {

err := postgres.Generate(
tempTestDir,
dbConnection,
Expand Down

0 comments on commit 6a0798e

Please sign in to comment.