dotnet / dotnet/EntityFramework.Docs

defaultValue purpose

Open
#2,362 1 comment 0 reactions 0 assignees View on GitHub
area-model-building
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

Hi!
I think it would be helpful to explain whether/or not there be a long-term effect of the defaultValue parameter value. It's not clear if defaultValue argument will be used only when adding a column (to provide a value for existing rows only) or if the value will be written as a constraint (with a fixed value) to affect ALL future INSERTs. The documentation is lacking clarity, please explain. We have high hopes for this column (since defaultValueSql setting would be provider-specific, for instance a benign GETDATE() call will work in MS-SQL but fail against a Postgres database, where the function name is NOW()).

---
#### Document Details

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

* ID: 2457b1c1-0553-04c3-09c7-987435b320b5
* Version Independent ID: a38da295-b419-9bbc-3ecb-cb1b0207b70c
* Content: [MigrationBuilder.AddColumn Method (Microsoft.EntityFrameworkCore.Migrations)](https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.migrations.migrationbuilder.addcolumn?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev16.query%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder.AddColumn%60%601);k(SolutionItemsProject);k(DevLang-csharp)%26rd%3Dtrue&view=efcore-3.1)
* Content Source: [dotnet/xml/Microsoft.EntityFrameworkCore.Migrations/MigrationBuilder.xml](https://github.com/aspnet/EntityFramework.ApiDocs/blob/live/dotnet/xml/Microsoft.EntityFrameworkCore.Migrations/MigrationBuilder.xml)
* Product: **entity-framework-core**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **divega**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.