34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
public class MyInfoMateDbContext : DbContext
|
|
{
|
|
public MyInfoMateDbContext(DbContextOptions<MyInfoMateDbContext> options) : base(options) { }
|
|
|
|
public DbSet<Instance> Instances { get; set; }
|
|
public DbSet<Configuration> Configurations { get; set; }
|
|
public DbSet<Section> Sections { get; set; }
|
|
public DbSet<Device> Devices { get; set; }
|
|
public DbSet<Resource> Resources { get; set; }
|
|
public DbSet<User> Users { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.Entity<Configuration>()
|
|
.Property(s => s.Title)
|
|
.HasColumnType("jsonb");
|
|
|
|
modelBuilder.Entity<Section>()
|
|
.Property(s => s.Title)
|
|
.HasColumnType("jsonb");
|
|
|
|
modelBuilder.Entity<Section>()
|
|
.Property(s => s.Description)
|
|
.HasColumnType("jsonb");
|
|
|
|
}
|
|
}
|
|
}
|