f2d6300d72
deploy / deploy (push) Failing after 13s
.gitignore has '/data' which Windows git (case-insensitive) silently matched '/Data/', so AppDbContext.cs was never committed and the Docker build (Linux, case-sensitive) failed with CS0234 'Data' not found. Renaming the directory to 'Database/' sidesteps the collision. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
679 B
C#
22 lines
679 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using SoroushAsadi.Models;
|
|
|
|
namespace SoroushAsadi.Database;
|
|
|
|
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<ContentSection> ContentSections => Set<ContentSection>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<ContentSection>(e =>
|
|
{
|
|
e.ToTable("sections");
|
|
e.HasKey(x => x.Key);
|
|
e.Property(x => x.Key).HasColumnName("key");
|
|
e.Property(x => x.DataJson).HasColumnName("data");
|
|
e.Property(x => x.UpdatedAt).HasColumnName("updated_at");
|
|
});
|
|
}
|
|
}
|