dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.58k stars 25.3k forks source link

For consistency: add-migration after applying validation rules #10429

Open shadialnamrouti opened 5 years ago

shadialnamrouti commented 5 years ago

It's worth mentioning that some validation rules must be applied to the DB schema for consistency by adding a new migration. e.g. add-migration AddingNewRules

Mainly, the following two attributes affect the schema: 1- [Required] will alter the relevant column and make it not null 2- [StringLength(60)] will alter the type of the column and make it nvarchar(60)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Legends commented 5 years ago

Correct!