17#pragma warning disable 612, 618
19 .HasAnnotation(
"ProductVersion",
"3.1.7")
20 .HasAnnotation(
"Relational:MaxIdentifierLength", 128)
21 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
23 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
25 b.Property<
long>(
"Id")
26 .ValueGeneratedOnAdd()
27 .HasColumnType(
"bigint")
28 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
30 b.Property<
int>(
"ChannelLimit")
31 .HasColumnType(
"int");
33 b.Property<
string>(
"ConnectionString")
35 .HasColumnType(
"nvarchar(max)")
38 b.Property<
bool?>(
"Enabled")
39 .HasColumnType(
"bit");
41 b.Property<
long>(
"InstanceId")
42 .HasColumnType(
"bigint");
44 b.Property<
string>(
"Name")
46 .HasColumnType(
"nvarchar(100)")
49 b.Property<
int>(
"Provider")
50 .HasColumnType(
"int");
52 b.Property<
long>(
"ReconnectionInterval")
53 .HasColumnType(
"bigint");
57 b.HasIndex(
"InstanceId",
"Name")
60 b.ToTable(
"ChatBots");
63 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
65 b.Property<
long>(
"Id")
66 .ValueGeneratedOnAdd()
67 .HasColumnType(
"bigint")
68 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
70 b.Property<
long>(
"ChatSettingsId")
71 .HasColumnType(
"bigint");
73 b.Property<decimal?>(
"DiscordChannelId")
74 .HasColumnType(
"decimal(20,0)");
76 b.Property<
string>(
"IrcChannel")
77 .HasColumnType(
"nvarchar(100)")
80 b.Property<
bool?>(
"IsAdminChannel")
82 .HasColumnType(
"bit");
84 b.Property<
bool?>(
"IsUpdatesChannel")
86 .HasColumnType(
"bit");
88 b.Property<
bool?>(
"IsWatchdogChannel")
90 .HasColumnType(
"bit");
92 b.Property<
string>(
"Tag")
93 .HasColumnType(
"nvarchar(max)")
98 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
100 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
102 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
104 .HasFilter(
"[IrcChannel] IS NOT NULL");
106 b.ToTable(
"ChatChannels");
109 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
111 b.Property<
long>(
"Id")
112 .ValueGeneratedOnAdd()
113 .HasColumnType(
"bigint")
114 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
116 b.Property<
string>(
"ByondVersion")
118 .HasColumnType(
"nvarchar(max)");
120 b.Property<
int?>(
"DMApiMajorVersion")
121 .HasColumnType(
"int");
123 b.Property<
int?>(
"DMApiMinorVersion")
124 .HasColumnType(
"int");
126 b.Property<
int?>(
"DMApiPatchVersion")
127 .HasColumnType(
"int");
129 b.Property<Guid?>(
"DirectoryName")
131 .HasColumnType(
"uniqueidentifier");
133 b.Property<
string>(
"DmeName")
135 .HasColumnType(
"nvarchar(max)");
137 b.Property<
int?>(
"GitHubDeploymentId")
138 .HasColumnType(
"int");
140 b.Property<
long?>(
"GitHubRepoId")
141 .HasColumnType(
"bigint");
143 b.Property<
long>(
"JobId")
144 .HasColumnType(
"bigint");
146 b.Property<
int?>(
"MinimumSecurityLevel")
147 .HasColumnType(
"int");
149 b.Property<
string>(
"Output")
151 .HasColumnType(
"nvarchar(max)");
153 b.Property<
long>(
"RevisionInformationId")
154 .HasColumnType(
"bigint");
158 b.HasIndex(
"DirectoryName");
163 b.HasIndex(
"RevisionInformationId");
165 b.ToTable(
"CompileJobs");
168 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
170 b.Property<
long>(
"Id")
171 .ValueGeneratedOnAdd()
172 .HasColumnType(
"bigint")
173 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
175 b.Property<
string>(
"AdditionalParameters")
177 .HasColumnType(
"nvarchar(max)")
178 .HasMaxLength(10000);
180 b.Property<
bool?>(
"AllowWebClient")
182 .HasColumnType(
"bit");
184 b.Property<
bool?>(
"AutoStart")
186 .HasColumnType(
"bit");
188 b.Property<
long>(
"HeartbeatSeconds")
189 .HasColumnType(
"bigint");
191 b.Property<
long>(
"InstanceId")
192 .HasColumnType(
"bigint");
194 b.Property<
int>(
"Port")
195 .HasColumnType(
"int");
197 b.Property<
int>(
"SecurityLevel")
198 .HasColumnType(
"int");
200 b.Property<
long>(
"StartupTimeout")
201 .HasColumnType(
"bigint");
203 b.Property<
long>(
"TopicRequestTimeout")
204 .HasColumnType(
"bigint");
208 b.HasIndex(
"InstanceId")
211 b.ToTable(
"DreamDaemonSettings");
214 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
216 b.Property<
long>(
"Id")
217 .ValueGeneratedOnAdd()
218 .HasColumnType(
"bigint")
219 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
221 b.Property<
int>(
"ApiValidationPort")
222 .HasColumnType(
"int");
224 b.Property<
int>(
"ApiValidationSecurityLevel")
225 .HasColumnType(
"int");
227 b.Property<
long>(
"InstanceId")
228 .HasColumnType(
"bigint");
230 b.Property<
string>(
"ProjectName")
231 .HasColumnType(
"nvarchar(max)")
232 .HasMaxLength(10000);
234 b.Property<
bool?>(
"RequireDMApiValidation")
236 .HasColumnType(
"bit");
240 b.HasIndex(
"InstanceId")
243 b.ToTable(
"DreamMakerSettings");
246 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
248 b.Property<
long>(
"Id")
249 .ValueGeneratedOnAdd()
250 .HasColumnType(
"bigint")
251 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
253 b.Property<
long>(
"AutoUpdateInterval")
254 .HasColumnType(
"bigint");
256 b.Property<
int>(
"ChatBotLimit")
257 .HasColumnType(
"int");
259 b.Property<
int>(
"ConfigurationType")
260 .HasColumnType(
"int");
262 b.Property<
string>(
"Name")
264 .HasColumnType(
"nvarchar(max)")
265 .HasMaxLength(10000);
267 b.Property<
bool?>(
"Online")
269 .HasColumnType(
"bit");
271 b.Property<
string>(
"Path")
273 .HasColumnType(
"nvarchar(450)");
280 b.ToTable(
"Instances");
283 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
285 b.Property<
long>(
"Id")
286 .ValueGeneratedOnAdd()
287 .HasColumnType(
"bigint")
288 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
290 b.Property<decimal>(
"ByondRights")
291 .HasColumnType(
"decimal(20,0)");
293 b.Property<decimal>(
"ChatBotRights")
294 .HasColumnType(
"decimal(20,0)");
296 b.Property<decimal>(
"ConfigurationRights")
297 .HasColumnType(
"decimal(20,0)");
299 b.Property<decimal>(
"DreamDaemonRights")
300 .HasColumnType(
"decimal(20,0)");
302 b.Property<decimal>(
"DreamMakerRights")
303 .HasColumnType(
"decimal(20,0)");
305 b.Property<
long>(
"InstanceId")
306 .HasColumnType(
"bigint");
308 b.Property<decimal>(
"InstanceUserRights")
309 .HasColumnType(
"decimal(20,0)");
311 b.Property<decimal>(
"RepositoryRights")
312 .HasColumnType(
"decimal(20,0)");
314 b.Property<
long>(
"UserId")
315 .HasColumnType(
"bigint");
319 b.HasIndex(
"InstanceId");
321 b.HasIndex(
"UserId",
"InstanceId")
324 b.ToTable(
"InstanceUsers");
327 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
329 b.Property<
long>(
"Id")
330 .ValueGeneratedOnAdd()
331 .HasColumnType(
"bigint")
332 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
334 b.Property<decimal?>(
"CancelRight")
335 .HasColumnType(
"decimal(20,0)");
337 b.Property<decimal?>(
"CancelRightsType")
338 .HasColumnType(
"decimal(20,0)");
340 b.Property<
bool?>(
"Cancelled")
342 .HasColumnType(
"bit");
344 b.Property<
long?>(
"CancelledById")
345 .HasColumnType(
"bigint");
347 b.Property<
string>(
"Description")
349 .HasColumnType(
"nvarchar(max)");
351 b.Property<
long?>(
"ErrorCode")
352 .HasColumnType(
"bigint");
354 b.Property<
string>(
"ExceptionDetails")
355 .HasColumnType(
"nvarchar(max)");
357 b.Property<
long>(
"InstanceId")
358 .HasColumnType(
"bigint");
360 b.Property<DateTimeOffset?>(
"StartedAt")
362 .HasColumnType(
"datetimeoffset");
364 b.Property<
long>(
"StartedById")
365 .HasColumnType(
"bigint");
367 b.Property<DateTimeOffset?>(
"StoppedAt")
368 .HasColumnType(
"datetimeoffset");
372 b.HasIndex(
"CancelledById");
374 b.HasIndex(
"InstanceId");
376 b.HasIndex(
"StartedById");
381 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
383 b.Property<
long>(
"Id")
384 .ValueGeneratedOnAdd()
385 .HasColumnType(
"bigint")
386 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
388 b.Property<
string>(
"AccessIdentifier")
390 .HasColumnType(
"nvarchar(max)");
392 b.Property<
long>(
"CompileJobId")
393 .HasColumnType(
"bigint");
395 b.Property<
int>(
"LaunchSecurityLevel")
396 .HasColumnType(
"int");
398 b.Property<
int>(
"Port")
399 .HasColumnType(
"int");
401 b.Property<
int>(
"ProcessId")
402 .HasColumnType(
"int");
404 b.Property<
int>(
"RebootState")
405 .HasColumnType(
"int");
409 b.HasIndex(
"CompileJobId");
411 b.ToTable(
"ReattachInformations");
414 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
416 b.Property<
long>(
"Id")
417 .ValueGeneratedOnAdd()
418 .HasColumnType(
"bigint")
419 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
421 b.Property<
string>(
"AccessToken")
422 .HasColumnType(
"nvarchar(max)")
423 .HasMaxLength(10000);
425 b.Property<
string>(
"AccessUser")
426 .HasColumnType(
"nvarchar(max)")
427 .HasMaxLength(10000);
429 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
431 .HasColumnType(
"bit");
433 b.Property<
bool?>(
"AutoUpdatesSynchronize")
435 .HasColumnType(
"bit");
437 b.Property<
string>(
"CommitterEmail")
439 .HasColumnType(
"nvarchar(max)")
440 .HasMaxLength(10000);
442 b.Property<
string>(
"CommitterName")
444 .HasColumnType(
"nvarchar(max)")
445 .HasMaxLength(10000);
447 b.Property<
bool?>(
"CreateGitHubDeployments")
449 .HasColumnType(
"bit");
451 b.Property<
long>(
"InstanceId")
452 .HasColumnType(
"bigint");
454 b.Property<
bool?>(
"PostTestMergeComment")
456 .HasColumnType(
"bit");
458 b.Property<
bool?>(
"PushTestMergeCommits")
460 .HasColumnType(
"bit");
462 b.Property<
bool?>(
"ShowTestMergeCommitters")
464 .HasColumnType(
"bit");
468 b.HasIndex(
"InstanceId")
471 b.ToTable(
"RepositorySettings");
474 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
476 b.Property<
long>(
"Id")
477 .ValueGeneratedOnAdd()
478 .HasColumnType(
"bigint")
479 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
481 b.Property<
long>(
"RevisionInformationId")
482 .HasColumnType(
"bigint");
484 b.Property<
long>(
"TestMergeId")
485 .HasColumnType(
"bigint");
489 b.HasIndex(
"RevisionInformationId");
491 b.HasIndex(
"TestMergeId");
493 b.ToTable(
"RevInfoTestMerges");
496 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
498 b.Property<
long>(
"Id")
499 .ValueGeneratedOnAdd()
500 .HasColumnType(
"bigint")
501 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
503 b.Property<
string>(
"CommitSha")
505 .HasColumnType(
"nvarchar(40)")
508 b.Property<
long>(
"InstanceId")
509 .HasColumnType(
"bigint");
511 b.Property<
string>(
"OriginCommitSha")
513 .HasColumnType(
"nvarchar(40)")
518 b.HasIndex(
"InstanceId",
"CommitSha")
521 b.ToTable(
"RevisionInformations");
524 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
526 b.Property<
long>(
"Id")
527 .ValueGeneratedOnAdd()
528 .HasColumnType(
"bigint")
529 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
531 b.Property<
string>(
"Author")
533 .HasColumnType(
"nvarchar(max)");
535 b.Property<
string>(
"BodyAtMerge")
537 .HasColumnType(
"nvarchar(max)");
539 b.Property<
string>(
"Comment")
540 .HasColumnType(
"nvarchar(max)")
541 .HasMaxLength(10000);
543 b.Property<DateTimeOffset>(
"MergedAt")
544 .HasColumnType(
"datetimeoffset");
546 b.Property<
long>(
"MergedById")
547 .HasColumnType(
"bigint");
549 b.Property<
int>(
"Number")
550 .HasColumnType(
"int");
552 b.Property<
long?>(
"PrimaryRevisionInformationId")
554 .HasColumnType(
"bigint");
556 b.Property<
string>(
"PullRequestRevision")
558 .HasColumnType(
"nvarchar(40)")
561 b.Property<
string>(
"TitleAtMerge")
563 .HasColumnType(
"nvarchar(max)");
565 b.Property<
string>(
"Url")
567 .HasColumnType(
"nvarchar(max)");
571 b.HasIndex(
"MergedById");
573 b.HasIndex(
"PrimaryRevisionInformationId")
576 b.ToTable(
"TestMerges");
579 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
581 b.Property<
long?>(
"Id")
582 .ValueGeneratedOnAdd()
583 .HasColumnType(
"bigint")
584 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
586 b.Property<decimal>(
"AdministrationRights")
587 .HasColumnType(
"decimal(20,0)");
589 b.Property<
string>(
"CanonicalName")
591 .HasColumnType(
"nvarchar(450)");
593 b.Property<DateTimeOffset?>(
"CreatedAt")
595 .HasColumnType(
"datetimeoffset");
597 b.Property<
long?>(
"CreatedById")
598 .HasColumnType(
"bigint");
600 b.Property<
bool?>(
"Enabled")
602 .HasColumnType(
"bit");
604 b.Property<decimal>(
"InstanceManagerRights")
605 .HasColumnType(
"decimal(20,0)");
607 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
608 .HasColumnType(
"datetimeoffset");
610 b.Property<
string>(
"Name")
612 .HasColumnType(
"nvarchar(max)")
613 .HasMaxLength(10000);
615 b.Property<
string>(
"PasswordHash")
616 .HasColumnType(
"nvarchar(max)");
618 b.Property<
string>(
"SystemIdentifier")
619 .HasColumnType(
"nvarchar(450)");
623 b.HasIndex(
"CanonicalName")
626 b.HasIndex(
"CreatedById");
628 b.HasIndex(
"SystemIdentifier")
630 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
635 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
637 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
638 .WithMany(
"ChatSettings")
639 .HasForeignKey(
"InstanceId")
640 .OnDelete(DeleteBehavior.Cascade)
644 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
646 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
647 .WithMany(
"Channels")
648 .HasForeignKey(
"ChatSettingsId")
649 .OnDelete(DeleteBehavior.Cascade)
653 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
655 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
657 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
658 .OnDelete(DeleteBehavior.Cascade)
661 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
662 .WithMany(
"CompileJobs")
663 .HasForeignKey(
"RevisionInformationId")
664 .OnDelete(DeleteBehavior.ClientNoAction)
668 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
670 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
671 .WithOne(
"DreamDaemonSettings")
672 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
673 .OnDelete(DeleteBehavior.Cascade)
677 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
679 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
680 .WithOne(
"DreamMakerSettings")
681 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
682 .OnDelete(DeleteBehavior.Cascade)
686 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
688 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
689 .WithMany(
"InstanceUsers")
690 .HasForeignKey(
"InstanceId")
691 .OnDelete(DeleteBehavior.Cascade)
694 b.HasOne(
"Tgstation.Server.Host.Models.User",
null)
695 .WithMany(
"InstanceUsers")
696 .HasForeignKey(
"UserId")
697 .OnDelete(DeleteBehavior.Cascade)
701 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
703 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
705 .HasForeignKey(
"CancelledById");
707 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
709 .HasForeignKey(
"InstanceId")
710 .OnDelete(DeleteBehavior.Cascade)
713 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
715 .HasForeignKey(
"StartedById")
716 .OnDelete(DeleteBehavior.Cascade)
720 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
722 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
724 .HasForeignKey(
"CompileJobId")
725 .OnDelete(DeleteBehavior.Cascade)
729 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
731 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
732 .WithOne(
"RepositorySettings")
733 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
734 .OnDelete(DeleteBehavior.Cascade)
738 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
740 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
741 .WithMany(
"ActiveTestMerges")
742 .HasForeignKey(
"RevisionInformationId")
743 .OnDelete(DeleteBehavior.Cascade)
746 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
747 .WithMany(
"RevisonInformations")
748 .HasForeignKey(
"TestMergeId")
749 .OnDelete(DeleteBehavior.ClientNoAction)
753 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
755 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
756 .WithMany(
"RevisionInformations")
757 .HasForeignKey(
"InstanceId")
758 .OnDelete(DeleteBehavior.Cascade)
762 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
764 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
765 .WithMany(
"TestMerges")
766 .HasForeignKey(
"MergedById")
767 .OnDelete(DeleteBehavior.Restrict)
770 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
771 .WithOne(
"PrimaryTestMerge")
772 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
773 .OnDelete(DeleteBehavior.Cascade)
777 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
779 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
780 .WithMany(
"CreatedUsers")
781 .HasForeignKey(
"CreatedById");
783#pragma warning restore 612, 618