slickext
slickext copied to clipboard
The column name generate problem
In https://github.com/jilen/slickext/blob/6ff01a971f63f0e4ff24657025d62be96a894312/src/main/scala/slick/ext/macros/table.scala#L137
use
"([a-z\\d])([A-Z])".r.replaceAllIn(name, "$1_$2").toLowerCase()
property "ChannelID" generate to column name "channel_id"
and use
"(?<!^)([A-Z\\d])".r.replaceAllIn(name, "_$1").toLowerCase()
the result is "channel_i_d"
so I think the old code is better.
This is hard to say which is better... Maybe we need a custom function for mapping table name
Perhaps we can see some code generate way in hibernate, ebean and so on.
@djx314 I decide to provide ability to custom naming strategy after Chinese new year
Great!