Skip to content

Commit

Permalink
Merge pull request #83 from clayellis/master
Browse files Browse the repository at this point in the history
Change default postgreSQLEnumTypeName to include full type path
  • Loading branch information
tanner0101 authored Jul 26, 2018
2 parents eea3a44 + bae54da commit 9be6598
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/FluentPostgreSQL/PostgreSQLEnum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ public protocol PostgreSQLEnum: PostgreSQLExpressionRepresentable, CaseIterable,
extension PostgreSQLEnum {
/// See `PostgreSQLEnum`.
public static var postgreSQLEnumTypeName: String {
return "\(self)".uppercased()
return String(reflecting: self)
.components(separatedBy: ".")
.dropFirst()
.joined(separator: "_")
// TODO: Determine if this should actually be uppercased.
// The PostgreSQL documentation for the ENUM type always
// shows this name being lowercased.
.uppercased()
}

/// See `PostgreSQLDataTypeStaticRepresentable`.
Expand Down

0 comments on commit 9be6598

Please sign in to comment.