From 8a59acfbeba7e76323185919d7ad7a64ca96f383 Mon Sep 17 00:00:00 2001 From: Clay Ellis Date: Mon, 16 Jul 2018 11:18:05 -0600 Subject: [PATCH] Update default migrationName to include full reflected type path minus module name. --- Sources/Fluent/Migration/AnyMigration.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Fluent/Migration/AnyMigration.swift b/Sources/Fluent/Migration/AnyMigration.swift index 62c07859..c9d54e20 100644 --- a/Sources/Fluent/Migration/AnyMigration.swift +++ b/Sources/Fluent/Migration/AnyMigration.swift @@ -15,8 +15,10 @@ public protocol AnyMigration { extension AnyMigration where Self: Migration { /// See `Migration`. public static var migrationName: String { - let _type = "\(type(of: self))" - return _type.components(separatedBy: ".Type").first ?? _type + return String(reflecting: self) + .components(separatedBy: ".") + .dropFirst() + .joined(separator: ".") } /// See `Migration`.