diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-03 23:06:05 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-03 23:06:05 +1000 |
| commit | 7c33b3f334cf91918add7af08866f2ea37ed9c3f (patch) | |
| tree | 8095a2d65e87a808fac62b47e315a4875cc86b73 /src/marlin.web/Data/ApplicationDbContext.cs | |
chore: initial commit
Diffstat (limited to 'src/marlin.web/Data/ApplicationDbContext.cs')
| -rw-r--r-- | src/marlin.web/Data/ApplicationDbContext.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/marlin.web/Data/ApplicationDbContext.cs b/src/marlin.web/Data/ApplicationDbContext.cs new file mode 100644 index 0000000..41ec4bc --- /dev/null +++ b/src/marlin.web/Data/ApplicationDbContext.cs @@ -0,0 +1,25 @@ +namespace marlin.web.Data; + +using System.Linq.Expressions; +using core; +using core.models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +public class ApplicationDbContext : DbContext +{ + public DbSet<VersionControlSource> Sources => this.Set<VersionControlSource>(); + public DbSet<Job> Jobs => this.Set<Job>(); + + public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) + : base(options) { } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder + .Entity<Agent>() + .OwnsOne(p => p.Capabilities, b => b.ToJson()); + + base.OnModelCreating(modelBuilder); + } +}
\ No newline at end of file |
