summaryrefslogtreecommitdiff
path: root/src/marlin.web/Data
diff options
context:
space:
mode:
authorMelodi <62381002+Melodi17@users.noreply.github.com>2026-09-03 23:06:05 +1000
committerMelodi <62381002+Melodi17@users.noreply.github.com>2026-09-03 23:06:05 +1000
commit7c33b3f334cf91918add7af08866f2ea37ed9c3f (patch)
tree8095a2d65e87a808fac62b47e315a4875cc86b73 /src/marlin.web/Data
chore: initial commit
Diffstat (limited to 'src/marlin.web/Data')
-rw-r--r--src/marlin.web/Data/ApplicationDbContext.cs25
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