[Unified validations] Update the validation database entities #357
[Unified validations] Update the validation database entities #357loic-sharma merged 3 commits intomasterfrom
Conversation
| using System; | ||
| using System.Data.Entity.Migrations; | ||
|
|
||
| public partial class AddGenericValidations : DbMigration |
There was a problem hiding this comment.
Please make sure to review these changes: bc9fc85
Please also review the SQL generated by this migration. You can find this in the pull request's description.
|
Good stuff. Nice test pass. I'm a little sad the schema is "weakening" with more nullable but I understand the desire to pick the "right" level of engineering effort. It'll probably be fine. |
a231a98 to
22838c9
Compare
|
@agr I checked on PROD validation database which constraints would be dropped by the generated migration. It turns out no constraints would be affected, so the constraint drops would no-op. SQL script to find constraints that would be dropped...SELECT name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.PackageValidationSets')
AND col_name(parent_object_id, parent_column_id) = 'PackageKey';
SELECT name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.PackageValidationSets')
AND col_name(parent_object_id, parent_column_id) = 'PackageId';
SELECT name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.PackageValidationSets')
AND col_name(parent_object_id, parent_column_id) = 'PackageNormalizedVersion'; |
| public ValidationMigrationsConfiguration() | ||
| { | ||
| AutomaticMigrationsEnabled = false; | ||
| CommandTimeout = (int)TimeSpan.FromMinutes(30).TotalSeconds; |
There was a problem hiding this comment.
This matches the Gallery DB's migration timeout: https://github.com/NuGet/NuGetGallery/blob/4bd46fcf6f366b5343f21c4cef1abdfe67d06c27/src/NuGetGallery/Migrations/MigrationsConfiguration.cs#L16
Updates the Gallery to the latest validation database entities, which had breaking changes. Note that this change does not display generic validations, this will be added by https://github.com/NuGet/Engineering/issues/3587. See: NuGet/ServerCommon#357 Part of: https://github.com/NuGet/Engineering/issues/3576
Updates jobs to the latest validation database entities, which had breaking changes. See: NuGet/ServerCommon#357 Part of: https://github.com/NuGet/Engineering/issues/3576
Background
Update the validation database as per the spec: https://github.com/NuGet/Engineering/blob/master/Server.Specs/OrchestratorUnifiedValidations.md#new-database-schema
Part of https://github.com/NuGet/Engineering/issues/3576
How to review
Migration's generated SQL...
How I verified this
Seed program...