From 5dbdebcfb16582dc0e1030842378c76c3c737490 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Tue, 16 Nov 2021 21:14:21 -0800 Subject: [PATCH] Fix enum generation for mysql --- CHANGELOG.md | 6 ++++++ main.go | 2 +- templates/main/singleton/boil_types.go.tpl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 663ca8bb3..743ed9392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [v4.8.3] - 2021-11-16 + +### Fixed + +- Fix bad use of titlecase in mysql enum name generation + ## [v4.8.2] - 2021-11-16 ### Fixed diff --git a/main.go b/main.go index 7c1494234..91d0e97c4 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ import ( "github.com/volatiletech/sqlboiler/v4/importers" ) -const sqlBoilerVersion = "4.8.2" +const sqlBoilerVersion = "4.8.3" var ( flagConfigFile string diff --git a/templates/main/singleton/boil_types.go.tpl b/templates/main/singleton/boil_types.go.tpl index 7b0217e80..832cd36aa 100644 --- a/templates/main/singleton/boil_types.go.tpl +++ b/templates/main/singleton/boil_types.go.tpl @@ -75,7 +75,7 @@ It only titlecases the EnumValue portion if it's snake-cased. {{- if $isNamed -}} {{ $enumName = titleCase $name}} {{- else -}} - {{ $enumName = titleCase $table.Name $col.Name}} + {{ $enumName = printf "%s%s" (titleCase $table.Name) (titleCase $col.Name)}} {{- end -}} {{if $.AddEnumTypes}}