EF Model integrity fixups

This commit is contained in:
Cyberboss
2018-09-18 15:05:11 -04:00
parent 71fe411c68
commit 56d7f38eeb
2 changed files with 7 additions and 0 deletions
@@ -11,6 +11,11 @@ namespace Tgstation.Server.Host.Models
/// </summary>
public Job Job { get; set; }
/// <summary>
/// The <see cref="Api.Models.Internal.Job.Id"/> of <see cref="Job"/>
/// </summary>
public long JobId { get; set; }
/// <summary>
/// See <see cref="Api.Models.CompileJob.RevisionInformation"/>
/// </summary>
@@ -112,6 +112,8 @@ namespace Tgstation.Server.Host.Models
modelBuilder.Entity<CompileJob>().HasIndex(x => x.DirectoryName);
modelBuilder.Entity<Job>().HasOne<CompileJob>().WithOne(x => x.Job).OnDelete(DeleteBehavior.Restrict);
var chatChannel = modelBuilder.Entity<ChatChannel>();
chatChannel.HasIndex(x => new { x.ChatSettingsId, x.IrcChannel }).IsUnique();
chatChannel.HasIndex(x => new { x.ChatSettingsId, x.DiscordChannelId }).IsUnique();