17#pragma warning disable 612, 618
19 .HasAnnotation(
"ProductVersion",
"3.1.5")
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<
long>(
"JobId")
138 .HasColumnType(
"bigint");
140 b.Property<
int>(
"MinimumSecurityLevel")
141 .HasColumnType(
"int");
143 b.Property<
string>(
"Output")
145 .HasColumnType(
"nvarchar(max)");
147 b.Property<
long>(
"RevisionInformationId")
148 .HasColumnType(
"bigint");
152 b.HasIndex(
"DirectoryName");
157 b.HasIndex(
"RevisionInformationId");
159 b.ToTable(
"CompileJobs");
162 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
164 b.Property<
long>(
"Id")
165 .ValueGeneratedOnAdd()
166 .HasColumnType(
"bigint")
167 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
169 b.Property<
bool?>(
"AllowWebClient")
171 .HasColumnType(
"bit");
173 b.Property<
bool?>(
"AutoStart")
175 .HasColumnType(
"bit");
177 b.Property<
long>(
"HeartbeatSeconds")
178 .HasColumnType(
"bigint");
180 b.Property<
long>(
"InstanceId")
181 .HasColumnType(
"bigint");
183 b.Property<
int>(
"Port")
184 .HasColumnType(
"int");
186 b.Property<
int>(
"SecurityLevel")
187 .HasColumnType(
"int");
189 b.Property<
long>(
"StartupTimeout")
190 .HasColumnType(
"bigint");
192 b.Property<
long>(
"TopicRequestTimeout")
193 .HasColumnType(
"bigint");
197 b.HasIndex(
"InstanceId")
200 b.ToTable(
"DreamDaemonSettings");
203 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
205 b.Property<
long>(
"Id")
206 .ValueGeneratedOnAdd()
207 .HasColumnType(
"bigint")
208 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
210 b.Property<
int>(
"ApiValidationPort")
211 .HasColumnType(
"int");
213 b.Property<
int>(
"ApiValidationSecurityLevel")
214 .HasColumnType(
"int");
216 b.Property<
long>(
"InstanceId")
217 .HasColumnType(
"bigint");
219 b.Property<
string>(
"ProjectName")
220 .HasColumnType(
"nvarchar(max)")
221 .HasMaxLength(10000);
225 b.HasIndex(
"InstanceId")
228 b.ToTable(
"DreamMakerSettings");
231 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
233 b.Property<
long>(
"Id")
234 .ValueGeneratedOnAdd()
235 .HasColumnType(
"bigint")
236 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
238 b.Property<
long>(
"AutoUpdateInterval")
239 .HasColumnType(
"bigint");
241 b.Property<
int>(
"ChatBotLimit")
242 .HasColumnType(
"int");
244 b.Property<
int>(
"ConfigurationType")
245 .HasColumnType(
"int");
247 b.Property<
string>(
"Name")
249 .HasColumnType(
"nvarchar(max)")
250 .HasMaxLength(10000);
252 b.Property<
bool?>(
"Online")
254 .HasColumnType(
"bit");
256 b.Property<
string>(
"Path")
258 .HasColumnType(
"nvarchar(450)");
265 b.ToTable(
"Instances");
268 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
270 b.Property<
long>(
"Id")
271 .ValueGeneratedOnAdd()
272 .HasColumnType(
"bigint")
273 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
275 b.Property<decimal>(
"ByondRights")
276 .HasColumnType(
"decimal(20,0)");
278 b.Property<decimal>(
"ChatBotRights")
279 .HasColumnType(
"decimal(20,0)");
281 b.Property<decimal>(
"ConfigurationRights")
282 .HasColumnType(
"decimal(20,0)");
284 b.Property<decimal>(
"DreamDaemonRights")
285 .HasColumnType(
"decimal(20,0)");
287 b.Property<decimal>(
"DreamMakerRights")
288 .HasColumnType(
"decimal(20,0)");
290 b.Property<
long>(
"InstanceId")
291 .HasColumnType(
"bigint");
293 b.Property<decimal>(
"InstanceUserRights")
294 .HasColumnType(
"decimal(20,0)");
296 b.Property<decimal>(
"RepositoryRights")
297 .HasColumnType(
"decimal(20,0)");
299 b.Property<
long?>(
"UserId")
301 .HasColumnType(
"bigint");
305 b.HasIndex(
"InstanceId");
307 b.HasIndex(
"UserId",
"InstanceId")
310 b.ToTable(
"InstanceUsers");
313 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
315 b.Property<
long>(
"Id")
316 .ValueGeneratedOnAdd()
317 .HasColumnType(
"bigint")
318 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
320 b.Property<decimal?>(
"CancelRight")
321 .HasColumnType(
"decimal(20,0)");
323 b.Property<decimal?>(
"CancelRightsType")
324 .HasColumnType(
"decimal(20,0)");
326 b.Property<
bool?>(
"Cancelled")
328 .HasColumnType(
"bit");
330 b.Property<
long?>(
"CancelledById")
331 .HasColumnType(
"bigint");
333 b.Property<
string>(
"Description")
335 .HasColumnType(
"nvarchar(max)");
337 b.Property<
long?>(
"ErrorCode")
338 .HasColumnType(
"bigint");
340 b.Property<
string>(
"ExceptionDetails")
341 .HasColumnType(
"nvarchar(max)");
343 b.Property<
long>(
"InstanceId")
344 .HasColumnType(
"bigint");
346 b.Property<DateTimeOffset?>(
"StartedAt")
348 .HasColumnType(
"datetimeoffset");
350 b.Property<
long>(
"StartedById")
351 .HasColumnType(
"bigint");
353 b.Property<DateTimeOffset?>(
"StoppedAt")
354 .HasColumnType(
"datetimeoffset");
358 b.HasIndex(
"CancelledById");
360 b.HasIndex(
"InstanceId");
362 b.HasIndex(
"StartedById");
367 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
369 b.Property<
long>(
"Id")
370 .ValueGeneratedOnAdd()
371 .HasColumnType(
"bigint")
372 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
374 b.Property<
string>(
"AccessIdentifier")
376 .HasColumnType(
"nvarchar(max)");
378 b.Property<
long>(
"CompileJobId")
379 .HasColumnType(
"bigint");
381 b.Property<
int>(
"LaunchSecurityLevel")
382 .HasColumnType(
"int");
384 b.Property<
int>(
"Port")
385 .HasColumnType(
"int");
387 b.Property<
int>(
"ProcessId")
388 .HasColumnType(
"int");
390 b.Property<
int>(
"RebootState")
391 .HasColumnType(
"int");
395 b.HasIndex(
"CompileJobId");
397 b.ToTable(
"ReattachInformations");
400 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
402 b.Property<
long>(
"Id")
403 .ValueGeneratedOnAdd()
404 .HasColumnType(
"bigint")
405 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
407 b.Property<
string>(
"AccessToken")
408 .HasColumnType(
"nvarchar(max)")
409 .HasMaxLength(10000);
411 b.Property<
string>(
"AccessUser")
412 .HasColumnType(
"nvarchar(max)")
413 .HasMaxLength(10000);
415 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
417 .HasColumnType(
"bit");
419 b.Property<
bool?>(
"AutoUpdatesSynchronize")
421 .HasColumnType(
"bit");
423 b.Property<
string>(
"CommitterEmail")
425 .HasColumnType(
"nvarchar(max)")
426 .HasMaxLength(10000);
428 b.Property<
string>(
"CommitterName")
430 .HasColumnType(
"nvarchar(max)")
431 .HasMaxLength(10000);
433 b.Property<
long>(
"InstanceId")
434 .HasColumnType(
"bigint");
436 b.Property<
bool?>(
"PostTestMergeComment")
438 .HasColumnType(
"bit");
440 b.Property<
bool?>(
"PushTestMergeCommits")
442 .HasColumnType(
"bit");
444 b.Property<
bool?>(
"ShowTestMergeCommitters")
446 .HasColumnType(
"bit");
450 b.HasIndex(
"InstanceId")
453 b.ToTable(
"RepositorySettings");
456 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
458 b.Property<
long>(
"Id")
459 .ValueGeneratedOnAdd()
460 .HasColumnType(
"bigint")
461 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
463 b.Property<
long>(
"RevisionInformationId")
464 .HasColumnType(
"bigint");
466 b.Property<
long>(
"TestMergeId")
467 .HasColumnType(
"bigint");
471 b.HasIndex(
"RevisionInformationId");
473 b.HasIndex(
"TestMergeId");
475 b.ToTable(
"RevInfoTestMerges");
478 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
480 b.Property<
long>(
"Id")
481 .ValueGeneratedOnAdd()
482 .HasColumnType(
"bigint")
483 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
485 b.Property<
string>(
"CommitSha")
487 .HasColumnType(
"nvarchar(40)")
490 b.Property<
long>(
"InstanceId")
491 .HasColumnType(
"bigint");
493 b.Property<
string>(
"OriginCommitSha")
495 .HasColumnType(
"nvarchar(40)")
500 b.HasIndex(
"InstanceId",
"CommitSha")
503 b.ToTable(
"RevisionInformations");
506 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
508 b.Property<
long>(
"Id")
509 .ValueGeneratedOnAdd()
510 .HasColumnType(
"bigint")
511 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
513 b.Property<
string>(
"Author")
515 .HasColumnType(
"nvarchar(max)");
517 b.Property<
string>(
"BodyAtMerge")
519 .HasColumnType(
"nvarchar(max)");
521 b.Property<
string>(
"Comment")
522 .HasColumnType(
"nvarchar(max)")
523 .HasMaxLength(10000);
525 b.Property<DateTimeOffset>(
"MergedAt")
526 .HasColumnType(
"datetimeoffset");
528 b.Property<
long>(
"MergedById")
529 .HasColumnType(
"bigint");
531 b.Property<
int>(
"Number")
532 .HasColumnType(
"int");
534 b.Property<
long?>(
"PrimaryRevisionInformationId")
536 .HasColumnType(
"bigint");
538 b.Property<
string>(
"PullRequestRevision")
540 .HasColumnType(
"nvarchar(40)")
543 b.Property<
string>(
"TitleAtMerge")
545 .HasColumnType(
"nvarchar(max)");
547 b.Property<
string>(
"Url")
549 .HasColumnType(
"nvarchar(max)");
553 b.HasIndex(
"MergedById");
555 b.HasIndex(
"PrimaryRevisionInformationId")
558 b.ToTable(
"TestMerges");
561 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
563 b.Property<
long?>(
"Id")
564 .ValueGeneratedOnAdd()
565 .HasColumnType(
"bigint")
566 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
568 b.Property<decimal>(
"AdministrationRights")
569 .HasColumnType(
"decimal(20,0)");
571 b.Property<
string>(
"CanonicalName")
573 .HasColumnType(
"nvarchar(450)");
575 b.Property<DateTimeOffset?>(
"CreatedAt")
577 .HasColumnType(
"datetimeoffset");
579 b.Property<
long?>(
"CreatedById")
580 .HasColumnType(
"bigint");
582 b.Property<
bool?>(
"Enabled")
584 .HasColumnType(
"bit");
586 b.Property<decimal>(
"InstanceManagerRights")
587 .HasColumnType(
"decimal(20,0)");
589 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
590 .HasColumnType(
"datetimeoffset");
592 b.Property<
string>(
"Name")
594 .HasColumnType(
"nvarchar(max)")
595 .HasMaxLength(10000);
597 b.Property<
string>(
"PasswordHash")
598 .HasColumnType(
"nvarchar(max)");
600 b.Property<
string>(
"SystemIdentifier")
601 .HasColumnType(
"nvarchar(450)");
605 b.HasIndex(
"CanonicalName")
608 b.HasIndex(
"CreatedById");
610 b.HasIndex(
"SystemIdentifier")
612 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
617 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
619 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
620 .WithMany(
"ChatSettings")
621 .HasForeignKey(
"InstanceId")
622 .OnDelete(DeleteBehavior.Cascade)
626 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
628 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
629 .WithMany(
"Channels")
630 .HasForeignKey(
"ChatSettingsId")
631 .OnDelete(DeleteBehavior.Cascade)
635 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
637 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
639 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
640 .OnDelete(DeleteBehavior.Cascade)
643 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
644 .WithMany(
"CompileJobs")
645 .HasForeignKey(
"RevisionInformationId")
646 .OnDelete(DeleteBehavior.ClientNoAction)
650 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
652 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
653 .WithOne(
"DreamDaemonSettings")
654 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
655 .OnDelete(DeleteBehavior.Cascade)
659 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
661 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
662 .WithOne(
"DreamMakerSettings")
663 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
664 .OnDelete(DeleteBehavior.Cascade)
668 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
670 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
671 .WithMany(
"InstanceUsers")
672 .HasForeignKey(
"InstanceId")
673 .OnDelete(DeleteBehavior.Cascade)
676 b.HasOne(
"Tgstation.Server.Host.Models.User",
null)
677 .WithMany(
"InstanceUsers")
678 .HasForeignKey(
"UserId")
679 .OnDelete(DeleteBehavior.Cascade)
683 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
685 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
687 .HasForeignKey(
"CancelledById");
689 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
691 .HasForeignKey(
"InstanceId")
692 .OnDelete(DeleteBehavior.Cascade)
695 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
697 .HasForeignKey(
"StartedById")
698 .OnDelete(DeleteBehavior.Cascade)
702 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
704 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
706 .HasForeignKey(
"CompileJobId")
707 .OnDelete(DeleteBehavior.Cascade)
711 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
713 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
714 .WithOne(
"RepositorySettings")
715 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
716 .OnDelete(DeleteBehavior.Cascade)
720 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
722 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
723 .WithMany(
"ActiveTestMerges")
724 .HasForeignKey(
"RevisionInformationId")
725 .OnDelete(DeleteBehavior.Cascade)
728 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
729 .WithMany(
"RevisonInformations")
730 .HasForeignKey(
"TestMergeId")
731 .OnDelete(DeleteBehavior.ClientNoAction)
735 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
737 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
738 .WithMany(
"RevisionInformations")
739 .HasForeignKey(
"InstanceId")
740 .OnDelete(DeleteBehavior.Cascade)
744 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
746 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
747 .WithMany(
"TestMerges")
748 .HasForeignKey(
"MergedById")
749 .OnDelete(DeleteBehavior.Restrict)
752 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
753 .WithOne(
"PrimaryTestMerge")
754 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
755 .OnDelete(DeleteBehavior.Cascade)
759 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
761 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
762 .WithMany(
"CreatedUsers")
763 .HasForeignKey(
"CreatedById");
765#pragma warning restore 612, 618