mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 15:37:23 +01:00
partial revert + change
This commit is contained in:
parent
88cec262cd
commit
a5a2ce7e34
10 changed files with 61 additions and 236 deletions
|
|
@ -1,16 +1,12 @@
|
|||
using MareSynchronosShared.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace MareSynchronosShared.Data;
|
||||
|
||||
public class MareDbContext : DbContext
|
||||
{
|
||||
#if DEBUG
|
||||
public MareDbContext() { }
|
||||
public MareDbContext(DbContextOptions<MareDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
|
@ -29,6 +25,11 @@ public class MareDbContext : DbContext
|
|||
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
#endif
|
||||
|
||||
public MareDbContext(DbContextOptions<MareDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<FileCache> Files { get; set; }
|
||||
|
|
@ -38,7 +39,6 @@ public class MareDbContext : DbContext
|
|||
public DbSet<Auth> Auth { get; set; }
|
||||
public DbSet<LodeStoneAuth> LodeStoneAuth { get; set; }
|
||||
public DbSet<BannedRegistrations> BannedRegistrations { get; set; }
|
||||
public DbSet<Alias> Aliases { get; set; }
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
|
@ -46,8 +46,6 @@ public class MareDbContext : DbContext
|
|||
modelBuilder.Entity<Auth>().ToTable("auth");
|
||||
modelBuilder.Entity<User>().ToTable("users");
|
||||
modelBuilder.Entity<User>().HasIndex(c => c.CharacterIdentification);
|
||||
modelBuilder.Entity<Alias>().ToTable("aliases");
|
||||
modelBuilder.Entity<Alias>().HasIndex(c => c.AliasUID);
|
||||
modelBuilder.Entity<FileCache>().ToTable("file_caches");
|
||||
modelBuilder.Entity<FileCache>().HasIndex(c => c.UploaderUID);
|
||||
modelBuilder.Entity<ClientPair>().ToTable("client_pairs");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue