18#pragma warning disable 612, 618
20 .HasAnnotation(
"ProductVersion",
"2.2.6-servicing-10079")
21 .HasAnnotation(
"Relational:MaxIdentifierLength", 128)
22 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
24 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
26 b.Property<
long>(
"Id")
27 .ValueGeneratedOnAdd()
28 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
30 b.Property<
string>(
"ConnectionString")
34 b.Property<
bool?>(
"Enabled");
36 b.Property<
long>(
"InstanceId");
38 b.Property<
string>(
"Name")
42 b.Property<
int>(
"Provider");
44 b.Property<
long>(
"ReconnectionInterval");
48 b.HasIndex(
"InstanceId",
"Name")
51 b.ToTable(
"ChatBots");
54 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
56 b.Property<
long>(
"Id")
57 .ValueGeneratedOnAdd()
58 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 b.Property<
long>(
"ChatSettingsId");
62 b.Property<decimal?>(
"DiscordChannelId")
63 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
65 b.Property<
string>(
"IrcChannel")
68 b.Property<
bool?>(
"IsAdminChannel")
71 b.Property<
bool?>(
"IsUpdatesChannel")
74 b.Property<
bool?>(
"IsWatchdogChannel")
77 b.Property<
string>(
"Tag")
82 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
84 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
86 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
88 .HasFilter(
"[IrcChannel] IS NOT NULL");
90 b.ToTable(
"ChatChannels");
93 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
95 b.Property<
long>(
"Id")
96 .ValueGeneratedOnAdd()
97 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
99 b.Property<
string>(
"ByondVersion")
102 b.Property<Guid?>(
"DirectoryName")
105 b.Property<
string>(
"DmeName")
108 b.Property<
long>(
"JobId");
110 b.Property<
int>(
"MinimumSecurityLevel");
112 b.Property<
string>(
"Output")
115 b.Property<
long>(
"RevisionInformationId");
119 b.HasIndex(
"DirectoryName");
124 b.HasIndex(
"RevisionInformationId");
126 b.ToTable(
"CompileJobs");
129 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
131 b.Property<
long>(
"Id")
132 .ValueGeneratedOnAdd()
133 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
135 b.Property<
string>(
"AccessToken");
137 b.Property<
bool?>(
"AllowWebClient")
140 b.Property<
bool?>(
"AutoStart")
143 b.Property<
long>(
"InstanceId");
145 b.Property<
int>(
"PrimaryPort");
147 b.Property<
int?>(
"ProcessId");
149 b.Property<
int>(
"SecondaryPort");
151 b.Property<
int>(
"SecurityLevel");
153 b.Property<
bool?>(
"SoftRestart")
156 b.Property<
bool?>(
"SoftShutdown")
159 b.Property<
long>(
"StartupTimeout");
163 b.HasIndex(
"InstanceId")
166 b.ToTable(
"DreamDaemonSettings");
169 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
171 b.Property<
long>(
"Id")
172 .ValueGeneratedOnAdd()
173 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
175 b.Property<
int>(
"ApiValidationPort");
177 b.Property<
int>(
"ApiValidationSecurityLevel");
179 b.Property<
long>(
"InstanceId");
181 b.Property<
string>(
"ProjectName")
182 .HasMaxLength(10000);
186 b.HasIndex(
"InstanceId")
189 b.ToTable(
"DreamMakerSettings");
192 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
194 b.Property<
long>(
"Id")
195 .ValueGeneratedOnAdd()
196 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
198 b.Property<
long>(
"AutoUpdateInterval");
200 b.Property<
int>(
"ConfigurationType");
202 b.Property<
string>(
"Name")
204 .HasMaxLength(10000);
206 b.Property<
bool?>(
"Online")
209 b.Property<
string>(
"Path")
217 b.ToTable(
"Instances");
220 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
222 b.Property<
long>(
"Id")
223 .ValueGeneratedOnAdd()
224 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
226 b.Property<decimal>(
"ByondRights")
227 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
229 b.Property<decimal>(
"ChatBotRights")
230 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
232 b.Property<decimal>(
"ConfigurationRights")
233 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
235 b.Property<decimal>(
"DreamDaemonRights")
236 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
238 b.Property<decimal>(
"DreamMakerRights")
239 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
241 b.Property<
long>(
"InstanceId");
243 b.Property<decimal>(
"InstanceUserRights")
244 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
246 b.Property<decimal>(
"RepositoryRights")
247 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
249 b.Property<
long?>(
"UserId")
254 b.HasIndex(
"InstanceId");
256 b.HasIndex(
"UserId",
"InstanceId")
259 b.ToTable(
"InstanceUsers");
262 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
264 b.Property<
long>(
"Id")
265 .ValueGeneratedOnAdd()
266 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
268 b.Property<decimal?>(
"CancelRight")
269 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
271 b.Property<decimal?>(
"CancelRightsType")
272 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
274 b.Property<
bool?>(
"Cancelled")
277 b.Property<
long?>(
"CancelledById");
279 b.Property<
string>(
"Description")
282 b.Property<
string>(
"ExceptionDetails");
284 b.Property<
long>(
"InstanceId");
286 b.Property<DateTimeOffset?>(
"StartedAt")
289 b.Property<
long>(
"StartedById");
291 b.Property<DateTimeOffset?>(
"StoppedAt");
295 b.HasIndex(
"CancelledById");
297 b.HasIndex(
"InstanceId");
299 b.HasIndex(
"StartedById");
304 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
306 b.Property<
long>(
"Id")
307 .ValueGeneratedOnAdd()
308 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
310 b.Property<
string>(
"AccessIdentifier")
313 b.Property<
string>(
"ChatChannelsJson")
316 b.Property<
string>(
"ChatCommandsJson")
319 b.Property<
long>(
"CompileJobId");
321 b.Property<
bool>(
"IsPrimary");
323 b.Property<
int>(
"Port");
325 b.Property<
int>(
"ProcessId");
327 b.Property<
int>(
"RebootState");
329 b.Property<
string>(
"ServerCommandsJson")
334 b.HasIndex(
"CompileJobId");
336 b.ToTable(
"ReattachInformations");
339 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
341 b.Property<
long>(
"Id")
342 .ValueGeneratedOnAdd()
343 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
345 b.Property<
string>(
"AccessToken")
346 .HasMaxLength(10000);
348 b.Property<
string>(
"AccessUser")
349 .HasMaxLength(10000);
351 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
354 b.Property<
bool?>(
"AutoUpdatesSynchronize")
357 b.Property<
string>(
"CommitterEmail")
359 .HasMaxLength(10000);
361 b.Property<
string>(
"CommitterName")
363 .HasMaxLength(10000);
365 b.Property<
long>(
"InstanceId");
367 b.Property<
bool?>(
"PostTestMergeComment")
370 b.Property<
bool?>(
"PushTestMergeCommits")
373 b.Property<
bool?>(
"ShowTestMergeCommitters")
378 b.HasIndex(
"InstanceId")
381 b.ToTable(
"RepositorySettings");
384 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
386 b.Property<
long>(
"Id")
387 .ValueGeneratedOnAdd()
388 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
390 b.Property<
long>(
"RevisionInformationId");
392 b.Property<
long>(
"TestMergeId");
396 b.HasIndex(
"RevisionInformationId");
398 b.HasIndex(
"TestMergeId");
400 b.ToTable(
"RevInfoTestMerges");
403 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
405 b.Property<
long>(
"Id")
406 .ValueGeneratedOnAdd()
407 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
409 b.Property<
string>(
"CommitSha")
413 b.Property<
long>(
"InstanceId");
415 b.Property<
string>(
"OriginCommitSha")
421 b.HasIndex(
"InstanceId",
"CommitSha")
424 b.ToTable(
"RevisionInformations");
427 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
429 b.Property<
long>(
"Id")
430 .ValueGeneratedOnAdd()
431 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
433 b.Property<
string>(
"Author")
436 b.Property<
string>(
"BodyAtMerge")
439 b.Property<
string>(
"Comment")
440 .HasMaxLength(10000);
442 b.Property<DateTimeOffset>(
"MergedAt");
444 b.Property<
long>(
"MergedById");
446 b.Property<
int?>(
"Number")
449 b.Property<
long?>(
"PrimaryRevisionInformationId")
452 b.Property<
string>(
"PullRequestRevision")
456 b.Property<
string>(
"TitleAtMerge")
459 b.Property<
string>(
"Url")
464 b.HasIndex(
"MergedById");
466 b.HasIndex(
"PrimaryRevisionInformationId")
469 b.ToTable(
"TestMerges");
472 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
474 b.Property<
long>(
"Id")
475 .ValueGeneratedOnAdd()
476 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
478 b.Property<decimal>(
"AdministrationRights")
479 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
481 b.Property<
string>(
"CanonicalName")
484 b.Property<DateTimeOffset?>(
"CreatedAt")
487 b.Property<
long?>(
"CreatedById");
489 b.Property<
bool?>(
"Enabled")
492 b.Property<decimal>(
"InstanceManagerRights")
493 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
495 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
497 b.Property<
string>(
"Name")
499 .HasMaxLength(10000);
501 b.Property<
string>(
"PasswordHash");
503 b.Property<
string>(
"SystemIdentifier");
507 b.HasIndex(
"CanonicalName")
510 b.HasIndex(
"CreatedById");
512 b.HasIndex(
"SystemIdentifier")
514 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
519 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
521 b.Property<
long>(
"Id")
522 .ValueGeneratedOnAdd()
523 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
525 b.Property<
long?>(
"AlphaId");
527 b.Property<
bool>(
"AlphaIsActive");
529 b.Property<
long?>(
"BravoId");
531 b.Property<
long>(
"InstanceId");
535 b.HasIndex(
"AlphaId");
537 b.HasIndex(
"BravoId");
539 b.HasIndex(
"InstanceId")
542 b.ToTable(
"WatchdogReattachInformations");
545 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
547 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
548 .WithMany(
"ChatSettings")
549 .HasForeignKey(
"InstanceId")
550 .OnDelete(DeleteBehavior.Cascade);
553 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
555 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
556 .WithMany(
"Channels")
557 .HasForeignKey(
"ChatSettingsId")
558 .OnDelete(DeleteBehavior.Cascade);
561 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
563 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
565 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
566 .OnDelete(DeleteBehavior.Restrict);
568 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
569 .WithMany(
"CompileJobs")
570 .HasForeignKey(
"RevisionInformationId")
571 .OnDelete(DeleteBehavior.Cascade);
574 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
576 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
577 .WithOne(
"DreamDaemonSettings")
578 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
579 .OnDelete(DeleteBehavior.Cascade);
582 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
584 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
585 .WithOne(
"DreamMakerSettings")
586 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
587 .OnDelete(DeleteBehavior.Cascade);
590 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
592 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
593 .WithMany(
"InstanceUsers")
594 .HasForeignKey(
"InstanceId")
595 .OnDelete(DeleteBehavior.Cascade);
597 b.HasOne(
"Tgstation.Server.Host.Models.User")
598 .WithMany(
"InstanceUsers")
599 .HasForeignKey(
"UserId")
600 .OnDelete(DeleteBehavior.Cascade);
603 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
605 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
607 .HasForeignKey(
"CancelledById");
609 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
611 .HasForeignKey(
"InstanceId")
612 .OnDelete(DeleteBehavior.Cascade);
614 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
616 .HasForeignKey(
"StartedById")
617 .OnDelete(DeleteBehavior.Cascade);
620 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
622 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
624 .HasForeignKey(
"CompileJobId")
625 .OnDelete(DeleteBehavior.Cascade);
628 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
630 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
631 .WithOne(
"RepositorySettings")
632 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
633 .OnDelete(DeleteBehavior.Cascade);
636 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
638 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
639 .WithMany(
"ActiveTestMerges")
640 .HasForeignKey(
"RevisionInformationId")
641 .OnDelete(DeleteBehavior.Cascade);
643 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
644 .WithMany(
"RevisonInformations")
645 .HasForeignKey(
"TestMergeId")
646 .OnDelete(DeleteBehavior.Cascade);
649 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
651 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
652 .WithMany(
"RevisionInformations")
653 .HasForeignKey(
"InstanceId")
654 .OnDelete(DeleteBehavior.Cascade);
657 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
659 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
660 .WithMany(
"TestMerges")
661 .HasForeignKey(
"MergedById")
662 .OnDelete(DeleteBehavior.Restrict);
664 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
665 .WithOne(
"PrimaryTestMerge")
666 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
667 .OnDelete(DeleteBehavior.Restrict);
670 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
672 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
673 .WithMany(
"CreatedUsers")
674 .HasForeignKey(
"CreatedById");
677 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
679 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
681 .HasForeignKey(
"AlphaId");
683 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
685 .HasForeignKey(
"BravoId");
687 b.HasOne(
"Tgstation.Server.Host.Models.Instance")
688 .WithOne(
"WatchdogReattachInformation")
689 .HasForeignKey(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"InstanceId")
690 .OnDelete(DeleteBehavior.Cascade);
692#pragma warning restore 612, 618