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")
33 b.Property<
bool?>(
"Enabled");
35 b.Property<
long>(
"InstanceId");
37 b.Property<
string>(
"Name")
40 b.Property<
int?>(
"Provider");
42 b.Property<
long>(
"ReconnectionInterval");
46 b.HasIndex(
"InstanceId");
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");
67 b.Property<
bool?>(
"IsAdminChannel")
70 b.Property<
bool?>(
"IsUpdatesChannel")
73 b.Property<
bool?>(
"IsWatchdogChannel")
76 b.Property<
string>(
"Tag");
80 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
82 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
84 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
86 .HasFilter(
"[IrcChannel] IS NOT NULL");
88 b.ToTable(
"ChatChannels");
91 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
93 b.Property<
long>(
"Id")
94 .ValueGeneratedOnAdd()
95 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 b.Property<
string>(
"ByondVersion")
100 b.Property<Guid?>(
"DirectoryName")
103 b.Property<
string>(
"DmeName")
106 b.Property<
long>(
"JobId");
108 b.Property<
int>(
"MinimumSecurityLevel");
110 b.Property<
string>(
"Output")
113 b.Property<
long>(
"RevisionInformationId");
117 b.HasIndex(
"DirectoryName");
122 b.HasIndex(
"RevisionInformationId");
124 b.ToTable(
"CompileJobs");
127 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
129 b.Property<
long>(
"Id")
130 .ValueGeneratedOnAdd()
131 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
133 b.Property<
string>(
"AccessToken");
135 b.Property<
bool?>(
"AllowWebClient")
138 b.Property<
bool?>(
"AutoStart")
141 b.Property<
long>(
"InstanceId");
143 b.Property<
int>(
"PrimaryPort");
145 b.Property<
int?>(
"ProcessId");
147 b.Property<
int>(
"SecondaryPort");
149 b.Property<
int>(
"SecurityLevel");
151 b.Property<
bool?>(
"SoftRestart")
154 b.Property<
bool?>(
"SoftShutdown")
157 b.Property<
long>(
"StartupTimeout");
161 b.HasIndex(
"InstanceId")
164 b.ToTable(
"DreamDaemonSettings");
167 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
169 b.Property<
long>(
"Id")
170 .ValueGeneratedOnAdd()
171 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
173 b.Property<
int>(
"ApiValidationPort");
175 b.Property<
int>(
"ApiValidationSecurityLevel");
177 b.Property<
long>(
"InstanceId");
179 b.Property<
string>(
"ProjectName");
183 b.HasIndex(
"InstanceId")
186 b.ToTable(
"DreamMakerSettings");
189 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
191 b.Property<
long>(
"Id")
192 .ValueGeneratedOnAdd()
193 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
195 b.Property<
long>(
"AutoUpdateInterval");
197 b.Property<
int>(
"ConfigurationType");
199 b.Property<
string>(
"Name")
202 b.Property<
bool?>(
"Online")
205 b.Property<
string>(
"Path")
213 b.ToTable(
"Instances");
216 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
218 b.Property<
long>(
"Id")
219 .ValueGeneratedOnAdd()
220 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 b.Property<decimal>(
"ByondRights")
223 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
225 b.Property<decimal>(
"ChatBotRights")
226 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
228 b.Property<decimal>(
"ConfigurationRights")
229 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
231 b.Property<decimal>(
"DreamDaemonRights")
232 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
234 b.Property<decimal>(
"DreamMakerRights")
235 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
237 b.Property<
long>(
"InstanceId");
239 b.Property<decimal>(
"InstanceUserRights")
240 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
242 b.Property<decimal>(
"RepositoryRights")
243 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
245 b.Property<
long?>(
"UserId")
250 b.HasIndex(
"InstanceId");
252 b.HasIndex(
"UserId",
"InstanceId")
255 b.ToTable(
"InstanceUsers");
258 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
260 b.Property<
long>(
"Id")
261 .ValueGeneratedOnAdd()
262 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 b.Property<decimal?>(
"CancelRight")
265 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
267 b.Property<decimal?>(
"CancelRightsType")
268 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
270 b.Property<
bool?>(
"Cancelled")
273 b.Property<
long?>(
"CancelledById");
275 b.Property<
string>(
"Description")
278 b.Property<
string>(
"ExceptionDetails");
280 b.Property<
long>(
"InstanceId");
282 b.Property<DateTimeOffset?>(
"StartedAt")
285 b.Property<
long>(
"StartedById");
287 b.Property<DateTimeOffset?>(
"StoppedAt");
291 b.HasIndex(
"CancelledById");
293 b.HasIndex(
"InstanceId");
295 b.HasIndex(
"StartedById");
300 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
302 b.Property<
long>(
"Id")
303 .ValueGeneratedOnAdd()
304 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 b.Property<
string>(
"AccessIdentifier")
309 b.Property<
string>(
"ChatChannelsJson")
312 b.Property<
string>(
"ChatCommandsJson")
315 b.Property<
long>(
"CompileJobId");
317 b.Property<
bool>(
"IsPrimary");
319 b.Property<
int>(
"Port");
321 b.Property<
int>(
"ProcessId");
323 b.Property<
int>(
"RebootState");
325 b.Property<
string>(
"ServerCommandsJson")
330 b.HasIndex(
"CompileJobId");
332 b.ToTable(
"ReattachInformations");
335 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
337 b.Property<
long>(
"Id")
338 .ValueGeneratedOnAdd()
339 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 b.Property<
string>(
"AccessToken");
343 b.Property<
string>(
"AccessUser");
345 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
348 b.Property<
bool?>(
"AutoUpdatesSynchronize")
351 b.Property<
string>(
"CommitterEmail")
354 b.Property<
string>(
"CommitterName")
357 b.Property<
long>(
"InstanceId");
359 b.Property<
bool?>(
"PostTestMergeComment")
362 b.Property<
bool?>(
"PushTestMergeCommits")
365 b.Property<
bool?>(
"ShowTestMergeCommitters")
370 b.HasIndex(
"InstanceId")
373 b.ToTable(
"RepositorySettings");
376 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
378 b.Property<
long>(
"Id")
379 .ValueGeneratedOnAdd()
380 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
382 b.Property<
long>(
"RevisionInformationId");
384 b.Property<
long>(
"TestMergeId");
388 b.HasIndex(
"RevisionInformationId");
390 b.HasIndex(
"TestMergeId");
392 b.ToTable(
"RevInfoTestMerges");
395 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
397 b.Property<
long>(
"Id")
398 .ValueGeneratedOnAdd()
399 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
401 b.Property<
string>(
"CommitSha")
405 b.Property<
long>(
"InstanceId");
407 b.Property<
string>(
"OriginCommitSha")
413 b.HasIndex(
"InstanceId",
"CommitSha")
416 b.ToTable(
"RevisionInformations");
419 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
421 b.Property<
long>(
"Id")
422 .ValueGeneratedOnAdd()
423 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
425 b.Property<
string>(
"Author")
428 b.Property<
string>(
"BodyAtMerge")
431 b.Property<
string>(
"Comment");
433 b.Property<DateTimeOffset>(
"MergedAt");
435 b.Property<
long>(
"MergedById");
437 b.Property<
int?>(
"Number")
440 b.Property<
long?>(
"PrimaryRevisionInformationId")
443 b.Property<
string>(
"PullRequestRevision")
446 b.Property<
string>(
"TitleAtMerge")
449 b.Property<
string>(
"Url")
454 b.HasIndex(
"MergedById");
456 b.HasIndex(
"PrimaryRevisionInformationId")
459 b.ToTable(
"TestMerges");
462 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
464 b.Property<
long>(
"Id")
465 .ValueGeneratedOnAdd()
466 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
468 b.Property<decimal>(
"AdministrationRights")
469 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
471 b.Property<
string>(
"CanonicalName")
474 b.Property<DateTimeOffset?>(
"CreatedAt")
477 b.Property<
long?>(
"CreatedById");
479 b.Property<
bool?>(
"Enabled")
482 b.Property<decimal>(
"InstanceManagerRights")
483 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
485 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
487 b.Property<
string>(
"Name")
490 b.Property<
string>(
"PasswordHash");
492 b.Property<
string>(
"SystemIdentifier");
496 b.HasIndex(
"CanonicalName")
499 b.HasIndex(
"CreatedById");
504 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
506 b.Property<
long>(
"Id")
507 .ValueGeneratedOnAdd()
508 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
510 b.Property<
long?>(
"AlphaId");
512 b.Property<
bool>(
"AlphaIsActive");
514 b.Property<
long?>(
"BravoId");
516 b.Property<
long>(
"InstanceId");
520 b.HasIndex(
"AlphaId");
522 b.HasIndex(
"BravoId");
524 b.HasIndex(
"InstanceId")
527 b.ToTable(
"WatchdogReattachInformations");
530 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
532 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
533 .WithMany(
"ChatSettings")
534 .HasForeignKey(
"InstanceId")
535 .OnDelete(DeleteBehavior.Cascade);
538 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
540 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
541 .WithMany(
"Channels")
542 .HasForeignKey(
"ChatSettingsId")
543 .OnDelete(DeleteBehavior.Cascade);
546 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
548 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
550 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
551 .OnDelete(DeleteBehavior.Restrict);
553 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
554 .WithMany(
"CompileJobs")
555 .HasForeignKey(
"RevisionInformationId")
556 .OnDelete(DeleteBehavior.Cascade);
559 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
561 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
562 .WithOne(
"DreamDaemonSettings")
563 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
564 .OnDelete(DeleteBehavior.Cascade);
567 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
569 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
570 .WithOne(
"DreamMakerSettings")
571 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
572 .OnDelete(DeleteBehavior.Cascade);
575 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
577 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
578 .WithMany(
"InstanceUsers")
579 .HasForeignKey(
"InstanceId")
580 .OnDelete(DeleteBehavior.Cascade);
582 b.HasOne(
"Tgstation.Server.Host.Models.User")
583 .WithMany(
"InstanceUsers")
584 .HasForeignKey(
"UserId")
585 .OnDelete(DeleteBehavior.Cascade);
588 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
590 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
592 .HasForeignKey(
"CancelledById");
594 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
596 .HasForeignKey(
"InstanceId")
597 .OnDelete(DeleteBehavior.Cascade);
599 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
601 .HasForeignKey(
"StartedById")
602 .OnDelete(DeleteBehavior.Cascade);
605 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
607 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
609 .HasForeignKey(
"CompileJobId")
610 .OnDelete(DeleteBehavior.Cascade);
613 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
615 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
616 .WithOne(
"RepositorySettings")
617 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
618 .OnDelete(DeleteBehavior.Cascade);
621 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
623 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
624 .WithMany(
"ActiveTestMerges")
625 .HasForeignKey(
"RevisionInformationId")
626 .OnDelete(DeleteBehavior.Cascade);
628 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
629 .WithMany(
"RevisonInformations")
630 .HasForeignKey(
"TestMergeId")
631 .OnDelete(DeleteBehavior.Cascade);
634 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
636 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
637 .WithMany(
"RevisionInformations")
638 .HasForeignKey(
"InstanceId")
639 .OnDelete(DeleteBehavior.Cascade);
642 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
644 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
645 .WithMany(
"TestMerges")
646 .HasForeignKey(
"MergedById")
647 .OnDelete(DeleteBehavior.Restrict);
649 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
650 .WithOne(
"PrimaryTestMerge")
651 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
652 .OnDelete(DeleteBehavior.Restrict);
655 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
657 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
658 .WithMany(
"CreatedUsers")
659 .HasForeignKey(
"CreatedById");
662 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
664 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
666 .HasForeignKey(
"AlphaId");
668 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
670 .HasForeignKey(
"BravoId");
672 b.HasOne(
"Tgstation.Server.Host.Models.Instance")
673 .WithOne(
"WatchdogReattachInformation")
674 .HasForeignKey(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"InstanceId")
675 .OnDelete(DeleteBehavior.Cascade);
677#pragma warning restore 612, 618