mirror of
https://github.com/Wessel/nhl-setgame.git
synced 2026-06-08 22:28:07 +02:00
17 lines
428 B
C#
Executable File
17 lines
428 B
C#
Executable File
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace backend.Models;
|
|
|
|
public class GameContext : DbContext
|
|
{
|
|
public GameContext(DbContextOptions<GameContext> options) : base(options) {
|
|
}
|
|
|
|
public DbSet<Game> Games { get; set; } = null!;
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
|
modelBuilder.Entity<Game>()
|
|
.Property(b => b.StartedAt)
|
|
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
|
}
|
|
} |