Stop hitting duplicate PK errors
This commit is contained in:
parent
c3ad406d1d
commit
87143f4562
8 changed files with 562 additions and 16 deletions
|
|
@ -145,7 +145,7 @@ namespace isnd.Controllers
|
|||
dbContext.PackageVersions.Remove(v);
|
||||
}
|
||||
|
||||
// FIXME default type or null
|
||||
// Default package type must be non-null for composite key consistency.
|
||||
if (types==null || types.Count==0)
|
||||
dbContext.PackageVersions.Add
|
||||
(new PackageVersion{
|
||||
|
|
@ -157,7 +157,7 @@ namespace isnd.Controllers
|
|||
Revision = version.Revision,
|
||||
IsPrerelease = version.IsPrerelease,
|
||||
FullString = version.ToFullString(),
|
||||
Type = null,
|
||||
Type = string.Empty,
|
||||
LatestCommit = commit
|
||||
});
|
||||
else
|
||||
|
|
@ -171,7 +171,7 @@ namespace isnd.Controllers
|
|||
Patch = version.Patch,
|
||||
IsPrerelease = version.IsPrerelease,
|
||||
FullString = version.ToFullString(),
|
||||
Type = type.Name,
|
||||
Type = type.Name ?? string.Empty,
|
||||
LatestCommit = commit
|
||||
};
|
||||
dbContext.PackageVersions.Add(pkgver);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue