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<
int>(
"ChannelLimit");
32 b.Property<
string>(
"ConnectionString")
36 b.Property<
bool?>(
"Enabled");
38 b.Property<
long>(
"InstanceId");
40 b.Property<
string>(
"Name")
44 b.Property<
int>(
"Provider");
46 b.Property<
long>(
"ReconnectionInterval");
50 b.HasIndex(
"InstanceId",
"Name")
53 b.ToTable(
"ChatBots");
56 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
58 b.Property<
long>(
"Id")
59 .ValueGeneratedOnAdd()
60 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
62 b.Property<
long>(
"ChatSettingsId");
64 b.Property<decimal?>(
"DiscordChannelId")
65 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
67 b.Property<
string>(
"IrcChannel")
70 b.Property<
bool?>(
"IsAdminChannel")
73 b.Property<
bool?>(
"IsUpdatesChannel")
76 b.Property<
bool?>(
"IsWatchdogChannel")
79 b.Property<
string>(
"Tag")
84 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
86 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
88 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
90 .HasFilter(
"[IrcChannel] IS NOT NULL");
92 b.ToTable(
"ChatChannels");
95 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
97 b.Property<
long>(
"Id")
98 .ValueGeneratedOnAdd()
99 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
101 b.Property<
string>(
"ByondVersion")
104 b.Property<Guid?>(
"DirectoryName")
107 b.Property<
string>(
"DmeName")
110 b.Property<
long>(
"JobId");
112 b.Property<
int>(
"MinimumSecurityLevel");
114 b.Property<
string>(
"Output")
117 b.Property<
long>(
"RevisionInformationId");
121 b.HasIndex(
"DirectoryName");
126 b.HasIndex(
"RevisionInformationId");
128 b.ToTable(
"CompileJobs");
131 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
133 b.Property<
long>(
"Id")
134 .ValueGeneratedOnAdd()
135 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
137 b.Property<
string>(
"AccessToken");
139 b.Property<
bool?>(
"AllowWebClient")
142 b.Property<
bool?>(
"AutoStart")
145 b.Property<
long>(
"InstanceId");
147 b.Property<
int>(
"PrimaryPort");
149 b.Property<
int?>(
"ProcessId");
151 b.Property<
int>(
"SecondaryPort");
153 b.Property<
int>(
"SecurityLevel");
155 b.Property<
bool?>(
"SoftRestart")
158 b.Property<
bool?>(
"SoftShutdown")
161 b.Property<
long>(
"StartupTimeout");
165 b.HasIndex(
"InstanceId")
168 b.ToTable(
"DreamDaemonSettings");
171 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
173 b.Property<
long>(
"Id")
174 .ValueGeneratedOnAdd()
175 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
177 b.Property<
int>(
"ApiValidationPort");
179 b.Property<
int>(
"ApiValidationSecurityLevel");
181 b.Property<
long>(
"InstanceId");
183 b.Property<
string>(
"ProjectName")
184 .HasMaxLength(10000);
188 b.HasIndex(
"InstanceId")
191 b.ToTable(
"DreamMakerSettings");
194 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
196 b.Property<
long>(
"Id")
197 .ValueGeneratedOnAdd()
198 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
200 b.Property<
long>(
"AutoUpdateInterval");
202 b.Property<
int>(
"ChatBotLimit");
204 b.Property<
int>(
"ConfigurationType");
206 b.Property<
string>(
"Name")
208 .HasMaxLength(10000);
210 b.Property<
bool?>(
"Online")
213 b.Property<
string>(
"Path")
221 b.ToTable(
"Instances");
224 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
226 b.Property<
long>(
"Id")
227 .ValueGeneratedOnAdd()
228 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
230 b.Property<decimal>(
"ByondRights")
231 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
233 b.Property<decimal>(
"ChatBotRights")
234 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
236 b.Property<decimal>(
"ConfigurationRights")
237 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
239 b.Property<decimal>(
"DreamDaemonRights")
240 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
242 b.Property<decimal>(
"DreamMakerRights")
243 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
245 b.Property<
long>(
"InstanceId");
247 b.Property<decimal>(
"InstanceUserRights")
248 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
250 b.Property<decimal>(
"RepositoryRights")
251 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
253 b.Property<
long?>(
"UserId")
258 b.HasIndex(
"InstanceId");
260 b.HasIndex(
"UserId",
"InstanceId")
263 b.ToTable(
"InstanceUsers");
266 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
268 b.Property<
long>(
"Id")
269 .ValueGeneratedOnAdd()
270 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
272 b.Property<decimal?>(
"CancelRight")
273 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
275 b.Property<decimal?>(
"CancelRightsType")
276 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
278 b.Property<
bool?>(
"Cancelled")
281 b.Property<
long?>(
"CancelledById");
283 b.Property<
string>(
"Description")
286 b.Property<
string>(
"ExceptionDetails");
288 b.Property<
long>(
"InstanceId");
290 b.Property<DateTimeOffset?>(
"StartedAt")
293 b.Property<
long?>(
"StartedById")
296 b.Property<DateTimeOffset?>(
"StoppedAt");
300 b.HasIndex(
"CancelledById");
302 b.HasIndex(
"InstanceId");
304 b.HasIndex(
"StartedById");
309 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
311 b.Property<
long>(
"Id")
312 .ValueGeneratedOnAdd()
313 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
315 b.Property<
string>(
"AccessIdentifier")
318 b.Property<
string>(
"ChatChannelsJson")
321 b.Property<
string>(
"ChatCommandsJson")
324 b.Property<
long>(
"CompileJobId");
326 b.Property<
bool>(
"IsPrimary");
328 b.Property<
int>(
"Port");
330 b.Property<
int>(
"ProcessId");
332 b.Property<
int>(
"RebootState");
334 b.Property<
string>(
"ServerCommandsJson")
339 b.HasIndex(
"CompileJobId");
341 b.ToTable(
"ReattachInformations");
344 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
346 b.Property<
long>(
"Id")
347 .ValueGeneratedOnAdd()
348 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
350 b.Property<
string>(
"AccessToken")
351 .HasMaxLength(10000);
353 b.Property<
string>(
"AccessUser")
354 .HasMaxLength(10000);
356 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
359 b.Property<
bool?>(
"AutoUpdatesSynchronize")
362 b.Property<
string>(
"CommitterEmail")
364 .HasMaxLength(10000);
366 b.Property<
string>(
"CommitterName")
368 .HasMaxLength(10000);
370 b.Property<
long>(
"InstanceId");
372 b.Property<
bool?>(
"PostTestMergeComment")
375 b.Property<
bool?>(
"PushTestMergeCommits")
378 b.Property<
bool?>(
"ShowTestMergeCommitters")
383 b.HasIndex(
"InstanceId")
386 b.ToTable(
"RepositorySettings");
389 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
391 b.Property<
long>(
"Id")
392 .ValueGeneratedOnAdd()
393 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
395 b.Property<
long>(
"RevisionInformationId");
397 b.Property<
long>(
"TestMergeId");
401 b.HasIndex(
"RevisionInformationId");
403 b.HasIndex(
"TestMergeId");
405 b.ToTable(
"RevInfoTestMerges");
408 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
410 b.Property<
long>(
"Id")
411 .ValueGeneratedOnAdd()
412 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
414 b.Property<
string>(
"CommitSha")
418 b.Property<
long>(
"InstanceId");
420 b.Property<
string>(
"OriginCommitSha")
426 b.HasIndex(
"InstanceId",
"CommitSha")
429 b.ToTable(
"RevisionInformations");
432 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
434 b.Property<
long>(
"Id")
435 .ValueGeneratedOnAdd()
436 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
438 b.Property<
string>(
"Author")
441 b.Property<
string>(
"BodyAtMerge")
444 b.Property<
string>(
"Comment")
445 .HasMaxLength(10000);
447 b.Property<DateTimeOffset>(
"MergedAt");
449 b.Property<
long?>(
"MergedById")
452 b.Property<
int>(
"Number");
454 b.Property<
long?>(
"PrimaryRevisionInformationId")
457 b.Property<
string>(
"PullRequestRevision")
461 b.Property<
string>(
"TitleAtMerge")
464 b.Property<
string>(
"Url")
469 b.HasIndex(
"MergedById");
471 b.HasIndex(
"PrimaryRevisionInformationId")
474 b.ToTable(
"TestMerges");
477 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
479 b.Property<
long?>(
"Id")
480 .ValueGeneratedOnAdd()
481 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
483 b.Property<decimal>(
"AdministrationRights")
484 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
486 b.Property<
string>(
"CanonicalName")
489 b.Property<DateTimeOffset?>(
"CreatedAt")
492 b.Property<
long?>(
"CreatedById");
494 b.Property<
bool?>(
"Enabled")
497 b.Property<decimal>(
"InstanceManagerRights")
498 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
500 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
502 b.Property<
string>(
"Name")
504 .HasMaxLength(10000);
506 b.Property<
string>(
"PasswordHash");
508 b.Property<
string>(
"SystemIdentifier");
512 b.HasIndex(
"CanonicalName")
515 b.HasIndex(
"CreatedById");
517 b.HasIndex(
"SystemIdentifier")
519 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
524 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
526 b.Property<
long>(
"Id")
527 .ValueGeneratedOnAdd()
528 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
530 b.Property<
long?>(
"AlphaId");
532 b.Property<
bool>(
"AlphaIsActive");
534 b.Property<
long?>(
"BravoId");
536 b.Property<
long>(
"InstanceId");
540 b.HasIndex(
"AlphaId");
542 b.HasIndex(
"BravoId");
544 b.HasIndex(
"InstanceId")
547 b.ToTable(
"WatchdogReattachInformations");
550 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
552 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
553 .WithMany(
"ChatSettings")
554 .HasForeignKey(
"InstanceId")
555 .OnDelete(DeleteBehavior.Cascade);
558 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
560 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
561 .WithMany(
"Channels")
562 .HasForeignKey(
"ChatSettingsId")
563 .OnDelete(DeleteBehavior.Cascade);
566 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
568 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
570 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
571 .OnDelete(DeleteBehavior.Restrict);
573 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
574 .WithMany(
"CompileJobs")
575 .HasForeignKey(
"RevisionInformationId")
576 .OnDelete(DeleteBehavior.Cascade);
579 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
581 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
582 .WithOne(
"DreamDaemonSettings")
583 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
584 .OnDelete(DeleteBehavior.Cascade);
587 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
589 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
590 .WithOne(
"DreamMakerSettings")
591 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
592 .OnDelete(DeleteBehavior.Cascade);
595 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
597 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
598 .WithMany(
"InstanceUsers")
599 .HasForeignKey(
"InstanceId")
600 .OnDelete(DeleteBehavior.Cascade);
602 b.HasOne(
"Tgstation.Server.Host.Models.User")
603 .WithMany(
"InstanceUsers")
604 .HasForeignKey(
"UserId")
605 .OnDelete(DeleteBehavior.Cascade);
608 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
610 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
612 .HasForeignKey(
"CancelledById");
614 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
616 .HasForeignKey(
"InstanceId")
617 .OnDelete(DeleteBehavior.Cascade);
619 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
621 .HasForeignKey(
"StartedById")
622 .OnDelete(DeleteBehavior.Cascade);
625 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
627 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
629 .HasForeignKey(
"CompileJobId")
630 .OnDelete(DeleteBehavior.Cascade);
633 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
635 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
636 .WithOne(
"RepositorySettings")
637 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
638 .OnDelete(DeleteBehavior.Cascade);
641 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
643 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
644 .WithMany(
"ActiveTestMerges")
645 .HasForeignKey(
"RevisionInformationId")
646 .OnDelete(DeleteBehavior.Cascade);
648 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
649 .WithMany(
"RevisonInformations")
650 .HasForeignKey(
"TestMergeId")
651 .OnDelete(DeleteBehavior.Cascade);
654 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
656 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
657 .WithMany(
"RevisionInformations")
658 .HasForeignKey(
"InstanceId")
659 .OnDelete(DeleteBehavior.Cascade);
662 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
664 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
665 .WithMany(
"TestMerges")
666 .HasForeignKey(
"MergedById")
667 .OnDelete(DeleteBehavior.Restrict);
669 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
670 .WithOne(
"PrimaryTestMerge")
671 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
672 .OnDelete(DeleteBehavior.Restrict);
675 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
677 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
678 .WithMany(
"CreatedUsers")
679 .HasForeignKey(
"CreatedById");
682 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
684 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
686 .HasForeignKey(
"AlphaId");
688 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
690 .HasForeignKey(
"BravoId");
692 b.HasOne(
"Tgstation.Server.Host.Models.Instance")
693 .WithOne(
"WatchdogReattachInformation")
694 .HasForeignKey(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"InstanceId")
695 .OnDelete(DeleteBehavior.Cascade);
697#pragma warning restore 612, 618