mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-29 21:33:38 +01:00
I don't know man, it's just too much
This commit is contained in:
parent
f6fbb4c862
commit
2b53c6a824
8 changed files with 381 additions and 93 deletions
|
|
@ -1,5 +1,8 @@
|
|||
using MareSynchronosServer.Models;
|
||||
using System.Collections.Generic;
|
||||
using MareSynchronos.API;
|
||||
using MareSynchronosServer.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MareSynchronosServer.Data
|
||||
{
|
||||
|
|
@ -12,12 +15,24 @@ namespace MareSynchronosServer.Data
|
|||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<FileCache> Files { get; set; }
|
||||
public DbSet<Whitelist> Whitelists { get; set; }
|
||||
public DbSet<Visibility> Visibilities { get; set; }
|
||||
public DbSet<CharacterData> CharacterData { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<User>().ToTable("Users");
|
||||
modelBuilder.Entity<FileCache>().ToTable("FileCaches");
|
||||
modelBuilder.Entity<Whitelist>().ToTable("Whitelists");
|
||||
modelBuilder.Entity<Visibility>().ToTable("Visibility")
|
||||
.HasKey(k => new { k.CID, k.OtherCID });
|
||||
modelBuilder.Entity<CharacterData>()
|
||||
.Property(b => b.EquipmentData)
|
||||
.HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<FileReplacementDto>>(v));
|
||||
modelBuilder.Entity<CharacterData>()
|
||||
.ToTable("CharacterData")
|
||||
.HasKey(k => new { k.UserId, k.JobId });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue