Skip to content

Commit bae54da

Browse files
committed
Remove the module name from the enum name.
1 parent e032327 commit bae54da

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/FluentPostgreSQL/PostgreSQLEnum.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ public protocol PostgreSQLEnum: PostgreSQLExpressionRepresentable, CaseIterable,
55
extension PostgreSQLEnum {
66
/// See `PostgreSQLEnum`.
77
public static var postgreSQLEnumTypeName: String {
8-
return String(reflecting: self).replacingOccurrences(of: ".", with: "_").uppercased()
8+
return String(reflecting: self)
9+
.components(separatedBy: ".")
10+
.dropFirst()
11+
.joined(separator: "_")
12+
// TODO: Determine if this should actually be uppercased.
13+
// The PostgreSQL documentation for the ENUM type always
14+
// shows this name being lowercased.
15+
.uppercased()
916
}
1017

1118
/// See `PostgreSQLDataTypeStaticRepresentable`.

0 commit comments

Comments
 (0)