4using Microsoft.EntityFrameworkCore;
5using Microsoft.EntityFrameworkCore.Infrastructure;
9 [
DbContext(typeof(SqlServerDatabaseContext))]
12 protected override void BuildModel(ModelBuilder modelBuilder)
14#pragma warning disable 612, 618
16 .HasAnnotation(
"ProductVersion",
"8.0.4")
17 .HasAnnotation(
"Relational:MaxIdentifierLength", 128);
19 SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
21 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
23 b.Property<
long?>(
"Id")
24 .ValueGeneratedOnAdd()
25 .HasColumnType(
"bigint");
27 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
29 b.Property<
int>(
"ChannelLimit")
30 .HasColumnType(
"int");
32 b.Property<
string>(
"ConnectionString")
35 .HasColumnType(
"nvarchar(max)");
37 b.Property<
bool?>(
"Enabled")
38 .HasColumnType(
"bit");
40 b.Property<
long>(
"InstanceId")
41 .HasColumnType(
"bigint");
43 b.Property<
string>(
"Name")
46 .HasColumnType(
"nvarchar(100)");
48 b.Property<
int>(
"Provider")
49 .HasColumnType(
"int");
51 b.Property<
long>(
"ReconnectionInterval")
52 .HasColumnType(
"bigint");
56 b.HasIndex(
"InstanceId",
"Name")
59 b.ToTable(
"ChatBots");
62 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
64 b.Property<
long>(
"Id")
65 .ValueGeneratedOnAdd()
66 .HasColumnType(
"bigint");
68 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
70 b.Property<
long>(
"ChatSettingsId")
71 .HasColumnType(
"bigint");
73 b.Property<decimal?>(
"DiscordChannelId")
74 .HasColumnType(
"decimal(20,0)");
76 b.Property<
string>(
"IrcChannel")
78 .HasColumnType(
"nvarchar(100)");
80 b.Property<
bool?>(
"IsAdminChannel")
82 .HasColumnType(
"bit");
84 b.Property<
bool?>(
"IsSystemChannel")
86 .HasColumnType(
"bit");
88 b.Property<
bool?>(
"IsUpdatesChannel")
90 .HasColumnType(
"bit");
92 b.Property<
bool?>(
"IsWatchdogChannel")
94 .HasColumnType(
"bit");
96 b.Property<
string>(
"Tag")
98 .HasColumnType(
"nvarchar(max)");
102 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
104 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
106 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
108 .HasFilter(
"[IrcChannel] IS NOT NULL");
110 b.ToTable(
"ChatChannels");
113 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
115 b.Property<
long?>(
"Id")
116 .ValueGeneratedOnAdd()
117 .HasColumnType(
"bigint");
119 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
121 b.Property<
int?>(
"DMApiMajorVersion")
122 .HasColumnType(
"int");
124 b.Property<
int?>(
"DMApiMinorVersion")
125 .HasColumnType(
"int");
127 b.Property<
int?>(
"DMApiPatchVersion")
128 .HasColumnType(
"int");
130 b.Property<Guid?>(
"DirectoryName")
132 .HasColumnType(
"uniqueidentifier");
134 b.Property<
string>(
"DmeName")
136 .HasColumnType(
"nvarchar(max)");
138 b.Property<
string>(
"EngineVersion")
140 .HasColumnType(
"nvarchar(max)");
142 b.Property<
int?>(
"GitHubDeploymentId")
143 .HasColumnType(
"int");
145 b.Property<
long?>(
"GitHubRepoId")
146 .HasColumnType(
"bigint");
148 b.Property<
long>(
"JobId")
149 .HasColumnType(
"bigint");
151 b.Property<
int?>(
"MinimumSecurityLevel")
152 .HasColumnType(
"int");
154 b.Property<
string>(
"Output")
156 .HasColumnType(
"nvarchar(max)");
158 b.Property<
string>(
"RepositoryOrigin")
159 .HasColumnType(
"nvarchar(max)");
161 b.Property<
long>(
"RevisionInformationId")
162 .HasColumnType(
"bigint");
166 b.HasIndex(
"DirectoryName");
171 b.HasIndex(
"RevisionInformationId");
173 b.ToTable(
"CompileJobs");
176 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
178 b.Property<
long>(
"Id")
179 .ValueGeneratedOnAdd()
180 .HasColumnType(
"bigint");
182 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
184 b.Property<
string>(
"AdditionalParameters")
187 .HasColumnType(
"nvarchar(max)");
189 b.Property<
bool?>(
"AllowWebClient")
191 .HasColumnType(
"bit");
193 b.Property<
bool?>(
"AutoStart")
195 .HasColumnType(
"bit");
197 b.Property<
bool?>(
"DumpOnHealthCheckRestart")
199 .HasColumnType(
"bit");
201 b.Property<
long>(
"HealthCheckSeconds")
202 .HasColumnType(
"bigint");
204 b.Property<
long>(
"InstanceId")
205 .HasColumnType(
"bigint");
207 b.Property<
bool?>(
"LogOutput")
209 .HasColumnType(
"bit");
211 b.Property<
long>(
"MapThreads")
212 .HasColumnType(
"bigint");
214 b.Property<
bool?>(
"Minidumps")
216 .HasColumnType(
"bit");
218 b.Property<
int>(
"Port")
219 .HasColumnType(
"int");
221 b.Property<
int>(
"SecurityLevel")
222 .HasColumnType(
"int");
224 b.Property<
bool?>(
"StartProfiler")
226 .HasColumnType(
"bit");
228 b.Property<
long>(
"StartupTimeout")
229 .HasColumnType(
"bigint");
231 b.Property<
long>(
"TopicRequestTimeout")
232 .HasColumnType(
"bigint");
234 b.Property<
int>(
"Visibility")
235 .HasColumnType(
"int");
239 b.HasIndex(
"InstanceId")
242 b.ToTable(
"DreamDaemonSettings");
245 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
247 b.Property<
long>(
"Id")
248 .ValueGeneratedOnAdd()
249 .HasColumnType(
"bigint");
251 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
253 b.Property<
int>(
"ApiValidationPort")
254 .HasColumnType(
"int");
256 b.Property<
int>(
"ApiValidationSecurityLevel")
257 .HasColumnType(
"int");
259 b.Property<
string>(
"CompilerAdditionalArguments")
261 .HasColumnType(
"nvarchar(max)");
263 b.Property<
long>(
"InstanceId")
264 .HasColumnType(
"bigint");
266 b.Property<
string>(
"ProjectName")
268 .HasColumnType(
"nvarchar(max)");
270 b.Property<
bool?>(
"RequireDMApiValidation")
272 .HasColumnType(
"bit");
274 b.Property<TimeSpan?>(
"Timeout")
276 .HasColumnType(
"time");
280 b.HasIndex(
"InstanceId")
283 b.ToTable(
"DreamMakerSettings");
286 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
288 b.Property<
long?>(
"Id")
289 .ValueGeneratedOnAdd()
290 .HasColumnType(
"bigint");
292 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
294 b.Property<
long>(
"AutoUpdateInterval")
295 .HasColumnType(
"bigint");
297 b.Property<
int>(
"ChatBotLimit")
298 .HasColumnType(
"int");
300 b.Property<
int>(
"ConfigurationType")
301 .HasColumnType(
"int");
303 b.Property<
string>(
"Name")
306 .HasColumnType(
"nvarchar(100)");
308 b.Property<
bool?>(
"Online")
310 .HasColumnType(
"bit");
312 b.Property<
string>(
"Path")
314 .HasColumnType(
"nvarchar(450)");
316 b.Property<
string>(
"SwarmIdentifer")
317 .HasColumnType(
"nvarchar(450)");
321 b.HasIndex(
"Path",
"SwarmIdentifer")
323 .HasFilter(
"[SwarmIdentifer] IS NOT NULL");
325 b.ToTable(
"Instances");
328 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstancePermissionSet", b =>
330 b.Property<
long>(
"Id")
331 .ValueGeneratedOnAdd()
332 .HasColumnType(
"bigint");
334 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
336 b.Property<decimal>(
"ChatBotRights")
337 .HasColumnType(
"decimal(20,0)");
339 b.Property<decimal>(
"ConfigurationRights")
340 .HasColumnType(
"decimal(20,0)");
342 b.Property<decimal>(
"DreamDaemonRights")
343 .HasColumnType(
"decimal(20,0)");
345 b.Property<decimal>(
"DreamMakerRights")
346 .HasColumnType(
"decimal(20,0)");
348 b.Property<decimal>(
"EngineRights")
349 .HasColumnType(
"decimal(20,0)");
351 b.Property<
long>(
"InstanceId")
352 .HasColumnType(
"bigint");
354 b.Property<decimal>(
"InstancePermissionSetRights")
355 .HasColumnType(
"decimal(20,0)");
357 b.Property<
long>(
"PermissionSetId")
358 .HasColumnType(
"bigint");
360 b.Property<decimal>(
"RepositoryRights")
361 .HasColumnType(
"decimal(20,0)");
365 b.HasIndex(
"InstanceId");
367 b.HasIndex(
"PermissionSetId",
"InstanceId")
370 b.ToTable(
"InstancePermissionSets");
373 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
375 b.Property<
long?>(
"Id")
376 .ValueGeneratedOnAdd()
377 .HasColumnType(
"bigint");
379 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
381 b.Property<decimal?>(
"CancelRight")
382 .HasColumnType(
"decimal(20,0)");
384 b.Property<decimal?>(
"CancelRightsType")
385 .HasColumnType(
"decimal(20,0)");
387 b.Property<
bool?>(
"Cancelled")
389 .HasColumnType(
"bit");
391 b.Property<
long?>(
"CancelledById")
392 .HasColumnType(
"bigint");
394 b.Property<
string>(
"Description")
396 .HasColumnType(
"nvarchar(max)");
398 b.Property<
long?>(
"ErrorCode")
399 .HasColumnType(
"bigint");
401 b.Property<
string>(
"ExceptionDetails")
402 .HasColumnType(
"nvarchar(max)");
404 b.Property<
long>(
"InstanceId")
405 .HasColumnType(
"bigint");
407 b.Property<
byte>(
"JobCode")
408 .HasColumnType(
"tinyint");
410 b.Property<DateTimeOffset?>(
"StartedAt")
412 .HasColumnType(
"datetimeoffset");
414 b.Property<
long>(
"StartedById")
415 .HasColumnType(
"bigint");
417 b.Property<DateTimeOffset?>(
"StoppedAt")
418 .HasColumnType(
"datetimeoffset");
422 b.HasIndex(
"CancelledById");
424 b.HasIndex(
"InstanceId");
426 b.HasIndex(
"StartedById");
431 modelBuilder.Entity(
"Tgstation.Server.Host.Models.OAuthConnection", b =>
433 b.Property<
long>(
"Id")
434 .ValueGeneratedOnAdd()
435 .HasColumnType(
"bigint");
437 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
439 b.Property<
string>(
"ExternalUserId")
442 .HasColumnType(
"nvarchar(100)");
444 b.Property<
int>(
"Provider")
445 .HasColumnType(
"int");
447 b.Property<
long?>(
"UserId")
448 .HasColumnType(
"bigint");
452 b.HasIndex(
"UserId");
454 b.HasIndex(
"Provider",
"ExternalUserId")
457 b.ToTable(
"OAuthConnections");
460 modelBuilder.Entity(
"Tgstation.Server.Host.Models.PermissionSet", b =>
462 b.Property<
long?>(
"Id")
463 .ValueGeneratedOnAdd()
464 .HasColumnType(
"bigint");
466 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
468 b.Property<decimal>(
"AdministrationRights")
469 .HasColumnType(
"decimal(20,0)");
471 b.Property<
long?>(
"GroupId")
472 .HasColumnType(
"bigint");
474 b.Property<decimal>(
"InstanceManagerRights")
475 .HasColumnType(
"decimal(20,0)");
477 b.Property<
long?>(
"UserId")
478 .HasColumnType(
"bigint");
482 b.HasIndex(
"GroupId")
484 .HasFilter(
"[GroupId] IS NOT NULL");
488 .HasFilter(
"[UserId] IS NOT NULL");
490 b.ToTable(
"PermissionSets");
493 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
495 b.Property<
long?>(
"Id")
496 .ValueGeneratedOnAdd()
497 .HasColumnType(
"bigint");
499 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
501 b.Property<
string>(
"AccessIdentifier")
503 .HasColumnType(
"nvarchar(max)");
505 b.Property<
long>(
"CompileJobId")
506 .HasColumnType(
"bigint");
508 b.Property<
long?>(
"InitialCompileJobId")
509 .HasColumnType(
"bigint");
511 b.Property<
int>(
"LaunchSecurityLevel")
512 .HasColumnType(
"int");
514 b.Property<
int>(
"LaunchVisibility")
515 .HasColumnType(
"int");
517 b.Property<
int>(
"Port")
518 .HasColumnType(
"int");
520 b.Property<
int>(
"ProcessId")
521 .HasColumnType(
"int");
523 b.Property<
int>(
"RebootState")
524 .HasColumnType(
"int");
526 b.Property<
int?>(
"TopicPort")
527 .HasColumnType(
"int");
531 b.HasIndex(
"CompileJobId");
533 b.HasIndex(
"InitialCompileJobId");
535 b.ToTable(
"ReattachInformations");
538 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
540 b.Property<
long>(
"Id")
541 .ValueGeneratedOnAdd()
542 .HasColumnType(
"bigint");
544 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
546 b.Property<
string>(
"AccessToken")
548 .HasColumnType(
"nvarchar(max)");
550 b.Property<
string>(
"AccessUser")
552 .HasColumnType(
"nvarchar(max)");
554 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
556 .HasColumnType(
"bit");
558 b.Property<
bool?>(
"AutoUpdatesSynchronize")
560 .HasColumnType(
"bit");
562 b.Property<
string>(
"CommitterEmail")
565 .HasColumnType(
"nvarchar(max)");
567 b.Property<
string>(
"CommitterName")
570 .HasColumnType(
"nvarchar(max)");
572 b.Property<
bool?>(
"CreateGitHubDeployments")
574 .HasColumnType(
"bit");
576 b.Property<
long>(
"InstanceId")
577 .HasColumnType(
"bigint");
579 b.Property<
bool?>(
"PostTestMergeComment")
581 .HasColumnType(
"bit");
583 b.Property<
bool?>(
"PushTestMergeCommits")
585 .HasColumnType(
"bit");
587 b.Property<
bool?>(
"ShowTestMergeCommitters")
589 .HasColumnType(
"bit");
591 b.Property<
bool?>(
"UpdateSubmodules")
593 .HasColumnType(
"bit");
597 b.HasIndex(
"InstanceId")
600 b.ToTable(
"RepositorySettings");
603 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
605 b.Property<
long>(
"Id")
606 .ValueGeneratedOnAdd()
607 .HasColumnType(
"bigint");
609 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
611 b.Property<
long>(
"RevisionInformationId")
612 .HasColumnType(
"bigint");
614 b.Property<
long>(
"TestMergeId")
615 .HasColumnType(
"bigint");
619 b.HasIndex(
"RevisionInformationId");
621 b.HasIndex(
"TestMergeId");
623 b.ToTable(
"RevInfoTestMerges");
626 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
628 b.Property<
long>(
"Id")
629 .ValueGeneratedOnAdd()
630 .HasColumnType(
"bigint");
632 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
634 b.Property<
string>(
"CommitSha")
637 .HasColumnType(
"nvarchar(40)");
639 b.Property<
long>(
"InstanceId")
640 .HasColumnType(
"bigint");
642 b.Property<
string>(
"OriginCommitSha")
645 .HasColumnType(
"nvarchar(40)");
647 b.Property<DateTimeOffset>(
"Timestamp")
648 .HasColumnType(
"datetimeoffset");
652 b.HasIndex(
"InstanceId",
"CommitSha")
655 b.ToTable(
"RevisionInformations");
658 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
660 b.Property<
long>(
"Id")
661 .ValueGeneratedOnAdd()
662 .HasColumnType(
"bigint");
664 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long>(
"Id"));
666 b.Property<
string>(
"Author")
668 .HasColumnType(
"nvarchar(max)");
670 b.Property<
string>(
"BodyAtMerge")
672 .HasColumnType(
"nvarchar(max)");
674 b.Property<
string>(
"Comment")
676 .HasColumnType(
"nvarchar(max)");
678 b.Property<DateTimeOffset>(
"MergedAt")
679 .HasColumnType(
"datetimeoffset");
681 b.Property<
long>(
"MergedById")
682 .HasColumnType(
"bigint");
684 b.Property<
int>(
"Number")
685 .HasColumnType(
"int");
687 b.Property<
long?>(
"PrimaryRevisionInformationId")
689 .HasColumnType(
"bigint");
691 b.Property<
string>(
"TargetCommitSha")
694 .HasColumnType(
"nvarchar(40)");
696 b.Property<
string>(
"TitleAtMerge")
698 .HasColumnType(
"nvarchar(max)");
700 b.Property<
string>(
"Url")
702 .HasColumnType(
"nvarchar(max)");
706 b.HasIndex(
"MergedById");
708 b.HasIndex(
"PrimaryRevisionInformationId")
711 b.ToTable(
"TestMerges");
714 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
716 b.Property<
long?>(
"Id")
717 .ValueGeneratedOnAdd()
718 .HasColumnType(
"bigint");
720 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
722 b.Property<
string>(
"CanonicalName")
725 .HasColumnType(
"nvarchar(100)");
727 b.Property<DateTimeOffset?>(
"CreatedAt")
729 .HasColumnType(
"datetimeoffset");
731 b.Property<
long?>(
"CreatedById")
732 .HasColumnType(
"bigint");
734 b.Property<
bool?>(
"Enabled")
736 .HasColumnType(
"bit");
738 b.Property<
long?>(
"GroupId")
739 .HasColumnType(
"bigint");
741 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
742 .HasColumnType(
"datetimeoffset");
744 b.Property<
string>(
"Name")
747 .HasColumnType(
"nvarchar(100)");
749 b.Property<
string>(
"PasswordHash")
750 .HasColumnType(
"nvarchar(max)");
752 b.Property<
string>(
"SystemIdentifier")
754 .HasColumnType(
"nvarchar(100)");
758 b.HasIndex(
"CanonicalName")
761 b.HasIndex(
"CreatedById");
763 b.HasIndex(
"GroupId");
765 b.HasIndex(
"SystemIdentifier")
767 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
772 modelBuilder.Entity(
"Tgstation.Server.Host.Models.UserGroup", b =>
774 b.Property<
long?>(
"Id")
775 .ValueGeneratedOnAdd()
776 .HasColumnType(
"bigint");
778 SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<
long?>(
"Id"));
780 b.Property<
string>(
"Name")
783 .HasColumnType(
"nvarchar(100)");
793 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
795 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
796 .WithMany(
"ChatSettings")
797 .HasForeignKey(
"InstanceId")
798 .OnDelete(DeleteBehavior.Cascade)
801 b.Navigation(
"Instance");
804 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
806 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
807 .WithMany(
"Channels")
808 .HasForeignKey(
"ChatSettingsId")
809 .OnDelete(DeleteBehavior.Cascade)
812 b.Navigation(
"ChatSettings");
815 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
817 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
819 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
820 .OnDelete(DeleteBehavior.Cascade)
823 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
824 .WithMany(
"CompileJobs")
825 .HasForeignKey(
"RevisionInformationId")
826 .OnDelete(DeleteBehavior.ClientNoAction)
831 b.Navigation(
"RevisionInformation");
834 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
836 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
837 .WithOne(
"DreamDaemonSettings")
838 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
839 .OnDelete(DeleteBehavior.Cascade)
842 b.Navigation(
"Instance");
845 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
847 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
848 .WithOne(
"DreamMakerSettings")
849 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
850 .OnDelete(DeleteBehavior.Cascade)
853 b.Navigation(
"Instance");
856 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstancePermissionSet", b =>
858 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
859 .WithMany(
"InstancePermissionSets")
860 .HasForeignKey(
"InstanceId")
861 .OnDelete(DeleteBehavior.Cascade)
864 b.HasOne(
"Tgstation.Server.Host.Models.PermissionSet",
"PermissionSet")
865 .WithMany(
"InstancePermissionSets")
866 .HasForeignKey(
"PermissionSetId")
867 .OnDelete(DeleteBehavior.Cascade)
870 b.Navigation(
"Instance");
872 b.Navigation(
"PermissionSet");
875 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
877 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
879 .HasForeignKey(
"CancelledById");
881 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
883 .HasForeignKey(
"InstanceId")
884 .OnDelete(DeleteBehavior.Cascade)
887 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
889 .HasForeignKey(
"StartedById")
890 .OnDelete(DeleteBehavior.Cascade)
893 b.Navigation(
"CancelledBy");
895 b.Navigation(
"Instance");
897 b.Navigation(
"StartedBy");
900 modelBuilder.Entity(
"Tgstation.Server.Host.Models.OAuthConnection", b =>
902 b.HasOne(
"Tgstation.Server.Host.Models.User",
"User")
903 .WithMany(
"OAuthConnections")
904 .HasForeignKey(
"UserId")
905 .OnDelete(DeleteBehavior.Cascade);
907 b.Navigation(
"User");
910 modelBuilder.Entity(
"Tgstation.Server.Host.Models.PermissionSet", b =>
912 b.HasOne(
"Tgstation.Server.Host.Models.UserGroup",
"Group")
913 .WithOne(
"PermissionSet")
914 .HasForeignKey(
"Tgstation.Server.Host.Models.PermissionSet",
"GroupId")
915 .OnDelete(DeleteBehavior.Cascade);
917 b.HasOne(
"Tgstation.Server.Host.Models.User",
"User")
918 .WithOne(
"PermissionSet")
919 .HasForeignKey(
"Tgstation.Server.Host.Models.PermissionSet",
"UserId")
920 .OnDelete(DeleteBehavior.Cascade);
922 b.Navigation(
"Group");
924 b.Navigation(
"User");
927 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
929 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
931 .HasForeignKey(
"CompileJobId")
932 .OnDelete(DeleteBehavior.Cascade)
935 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"InitialCompileJob")
937 .HasForeignKey(
"InitialCompileJobId");
939 b.Navigation(
"CompileJob");
941 b.Navigation(
"InitialCompileJob");
944 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
946 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
947 .WithOne(
"RepositorySettings")
948 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
949 .OnDelete(DeleteBehavior.Cascade)
952 b.Navigation(
"Instance");
955 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
957 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
958 .WithMany(
"ActiveTestMerges")
959 .HasForeignKey(
"RevisionInformationId")
960 .OnDelete(DeleteBehavior.Cascade)
963 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
964 .WithMany(
"RevisonInformations")
965 .HasForeignKey(
"TestMergeId")
966 .OnDelete(DeleteBehavior.ClientNoAction)
969 b.Navigation(
"RevisionInformation");
971 b.Navigation(
"TestMerge");
974 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
976 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
977 .WithMany(
"RevisionInformations")
978 .HasForeignKey(
"InstanceId")
979 .OnDelete(DeleteBehavior.Cascade)
982 b.Navigation(
"Instance");
985 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
987 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
988 .WithMany(
"TestMerges")
989 .HasForeignKey(
"MergedById")
990 .OnDelete(DeleteBehavior.Restrict)
993 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
994 .WithOne(
"PrimaryTestMerge")
995 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
996 .OnDelete(DeleteBehavior.Cascade)
999 b.Navigation(
"MergedBy");
1001 b.Navigation(
"PrimaryRevisionInformation");
1004 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
1006 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
1007 .WithMany(
"CreatedUsers")
1008 .HasForeignKey(
"CreatedById");
1010 b.HasOne(
"Tgstation.Server.Host.Models.UserGroup",
"Group")
1012 .HasForeignKey(
"GroupId");
1014 b.Navigation(
"CreatedBy");
1016 b.Navigation(
"Group");
1019 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
1021 b.Navigation(
"Channels");
1024 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
1026 b.Navigation(
"ChatSettings");
1028 b.Navigation(
"DreamDaemonSettings");
1030 b.Navigation(
"DreamMakerSettings");
1032 b.Navigation(
"InstancePermissionSets");
1034 b.Navigation(
"Jobs");
1036 b.Navigation(
"RepositorySettings");
1038 b.Navigation(
"RevisionInformations");
1041 modelBuilder.Entity(
"Tgstation.Server.Host.Models.PermissionSet", b =>
1043 b.Navigation(
"InstancePermissionSets");
1046 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
1048 b.Navigation(
"ActiveTestMerges");
1050 b.Navigation(
"CompileJobs");
1052 b.Navigation(
"PrimaryTestMerge");
1055 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
1057 b.Navigation(
"RevisonInformations");
1060 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
1062 b.Navigation(
"CreatedUsers");
1064 b.Navigation(
"OAuthConnections");
1066 b.Navigation(
"PermissionSet");
1068 b.Navigation(
"TestMerges");
1071 modelBuilder.Entity(
"Tgstation.Server.Host.Models.UserGroup", b =>
1073 b.Navigation(
"PermissionSet")
1076 b.Navigation(
"Users");
1078#pragma warning restore 612, 618
override void BuildModel(ModelBuilder modelBuilder)