Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.

Commit fb414a0

Browse files
committed
refactor attribute
1 parent 18c5282 commit fb414a0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Domain.Data.FluentMigrator/KnownMigrationAttribute.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ namespace Domain.Data.FluentMigrator
66
{
77
public class KnownMigrationAttribute : MigrationAttribute
88
{
9-
public KnownMigrationAttribute(string author, string jiraIssueOrBranchName, Type migrationType, int year, int month, int day, int hour, int minute)
10-
: base(CalculateValue(jiraIssueOrBranchName.GetHashCode(), year, month, day, hour, minute), GenerateDescription(author, migrationType))
9+
public KnownMigrationAttribute(string author, string issueName, Type migrationType, int year, int month, int day, int hour, int minute)
10+
: base(CalculateValue(issueName.GetHashCode(), year, month, day, hour, minute), GenerateDescription(author, issueName, migrationType))
1111
{
1212
Author = author;
1313
}
1414

1515
public string Author { get; private set; }
1616

17-
private static string GenerateDescription(string author, Type migrationType)
17+
private static string GenerateDescription(string author, string issueName, Type migrationType)
1818
{
19-
return $"Author:{author}, Migration:{migrationType.Name}";
19+
return $"Author:{author}, Issue:{issueName}, Migration:{migrationType.Name}";
2020
}
2121

22-
private static long CalculateValue(int jiraIssueOrBranchNameHash, int year, int month, int day, int hour, int minute)
22+
private static long CalculateValue(int issueName, int year, int month, int day, int hour, int minute)
2323
{
24-
return jiraIssueOrBranchNameHash * 1000000000000L + year * 100000000L + month * 1000000L + day * 10000L + hour * 100L + minute;
24+
return issueName * 1000000000000L + year * 100000000L + month * 1000000L + day * 10000L + hour * 100L + minute;
2525
}
2626
}
2727
}

versioninfo_ss.JPG

3.75 KB
Loading

0 commit comments

Comments
 (0)