MySQL - DateTime default value
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
How to send date filed with default value?
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
Model
public DateTime created_at { get; set; }
When post data, created_at field have value
0001-01-01 00:00:00
not default value.
--- EDIT ---
Model
[Write(false)] // <-- resolve problem but not 100% cool solution :(
public DateTime created_at { get; set; }
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named in the report. Reproduce the MySQL insert with the shown model and determine the expected handling of the database default without relying on [Write(false)]; done means created_at is populated by CURRENT_TIMESTAMP when posting data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, mysql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100