18#pragma warning disable 612, 618
20 .HasAnnotation(
"ProductVersion",
"2.1.3-rtm-32065")
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");
44 b.HasIndex(
"InstanceId");
49 b.ToTable(
"ChatBots");
52 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
54 b.Property<
long>(
"Id")
55 .ValueGeneratedOnAdd()
56 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
58 b.Property<
long>(
"ChatSettingsId");
60 b.Property<decimal?>(
"DiscordChannelId")
61 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
63 b.Property<
string>(
"IrcChannel");
65 b.Property<
bool?>(
"IsAdminChannel")
68 b.Property<
bool?>(
"IsUpdatesChannel")
71 b.Property<
bool?>(
"IsWatchdogChannel")
74 b.Property<
string>(
"Tag");
78 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
80 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
82 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
84 .HasFilter(
"[IrcChannel] IS NOT NULL");
86 b.ToTable(
"ChatChannels");
89 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
91 b.Property<
long>(
"Id")
92 .ValueGeneratedOnAdd()
93 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
95 b.Property<
string>(
"ByondVersion")
98 b.Property<Guid?>(
"DirectoryName");
100 b.Property<
string>(
"DmeName");
102 b.Property<
long?>(
"JobId");
104 b.Property<
int>(
"MinimumSecurityLevel");
106 b.Property<
string>(
"Output");
108 b.Property<
long>(
"RevisionInformationId");
112 b.HasIndex(
"DirectoryName");
116 b.HasIndex(
"RevisionInformationId");
118 b.ToTable(
"CompileJobs");
121 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
123 b.Property<
long>(
"Id")
124 .ValueGeneratedOnAdd()
125 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
127 b.Property<
string>(
"AccessToken");
129 b.Property<
bool?>(
"AllowWebClient")
132 b.Property<
bool?>(
"AutoStart")
135 b.Property<
long>(
"InstanceId");
137 b.Property<
int>(
"PrimaryPort");
139 b.Property<
int?>(
"ProcessId");
141 b.Property<
int>(
"SecondaryPort");
143 b.Property<
int>(
"SecurityLevel");
145 b.Property<
bool?>(
"SoftRestart")
148 b.Property<
bool?>(
"SoftShutdown")
151 b.Property<
long>(
"StartupTimeout");
155 b.HasIndex(
"InstanceId")
158 b.ToTable(
"DreamDaemonSettings");
161 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163 b.Property<
long>(
"Id")
164 .ValueGeneratedOnAdd()
165 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
167 b.Property<
int>(
"ApiValidationPort");
169 b.Property<
int>(
"ApiValidationSecurityLevel");
171 b.Property<
long>(
"InstanceId");
173 b.Property<
string>(
"ProjectName");
177 b.HasIndex(
"InstanceId")
180 b.ToTable(
"DreamMakerSettings");
183 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
185 b.Property<
long>(
"Id")
186 .ValueGeneratedOnAdd()
187 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
189 b.Property<
long>(
"AutoUpdateInterval");
191 b.Property<
int>(
"ConfigurationType");
193 b.Property<
string>(
"Name")
196 b.Property<
bool?>(
"Online")
199 b.Property<
string>(
"Path")
202 b.Property<
long?>(
"WatchdogReattachInformationId");
209 b.HasIndex(
"WatchdogReattachInformationId");
211 b.ToTable(
"Instances");
214 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
216 b.Property<
long>(
"Id")
217 .ValueGeneratedOnAdd()
218 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
220 b.Property<decimal>(
"ByondRights")
221 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
223 b.Property<decimal>(
"ChatBotRights")
224 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
226 b.Property<decimal>(
"ConfigurationRights")
227 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
229 b.Property<decimal>(
"DreamDaemonRights")
230 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
232 b.Property<decimal>(
"DreamMakerRights")
233 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
235 b.Property<
long>(
"InstanceId");
237 b.Property<decimal>(
"InstanceUserRights")
238 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
240 b.Property<decimal>(
"RepositoryRights")
241 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
243 b.Property<
long?>(
"UserId")
248 b.HasIndex(
"InstanceId");
250 b.HasIndex(
"UserId",
"InstanceId")
253 b.ToTable(
"InstanceUsers");
256 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
258 b.Property<
long>(
"Id")
259 .ValueGeneratedOnAdd()
260 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
262 b.Property<decimal?>(
"CancelRight")
263 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
265 b.Property<decimal?>(
"CancelRightsType")
266 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
268 b.Property<
bool?>(
"Cancelled")
271 b.Property<
long?>(
"CancelledById");
273 b.Property<
string>(
"Description")
276 b.Property<
string>(
"ExceptionDetails");
278 b.Property<
long>(
"InstanceId");
280 b.Property<DateTimeOffset?>(
"StartedAt")
283 b.Property<
long>(
"StartedById");
285 b.Property<DateTimeOffset?>(
"StoppedAt");
289 b.HasIndex(
"CancelledById");
291 b.HasIndex(
"InstanceId");
293 b.HasIndex(
"StartedById");
298 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
300 b.Property<
long>(
"Id")
301 .ValueGeneratedOnAdd()
302 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
304 b.Property<
string>(
"AccessIdentifier")
307 b.Property<
string>(
"ChatChannelsJson")
310 b.Property<
string>(
"ChatCommandsJson")
313 b.Property<
long?>(
"CompileJobId");
315 b.Property<
bool>(
"IsPrimary");
317 b.Property<
int>(
"Port");
319 b.Property<
int>(
"ProcessId");
321 b.Property<
int>(
"RebootState");
323 b.Property<
string>(
"ServerCommandsJson")
328 b.HasIndex(
"CompileJobId");
330 b.ToTable(
"ReattachInformations");
333 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
335 b.Property<
long>(
"Id")
336 .ValueGeneratedOnAdd()
337 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
339 b.Property<
string>(
"AccessToken");
341 b.Property<
string>(
"AccessUser");
343 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
346 b.Property<
bool?>(
"AutoUpdatesSynchronize")
349 b.Property<
string>(
"CommitterEmail")
352 b.Property<
string>(
"CommitterName")
355 b.Property<
long>(
"InstanceId");
357 b.Property<
bool?>(
"PushTestMergeCommits")
360 b.Property<
bool?>(
"ShowTestMergeCommitters")
365 b.HasIndex(
"InstanceId")
368 b.ToTable(
"RepositorySettings");
371 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
373 b.Property<
long>(
"Id")
374 .ValueGeneratedOnAdd()
375 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
377 b.Property<
long>(
"RevisionInformationId");
379 b.Property<
long>(
"TestMergeId");
383 b.HasIndex(
"RevisionInformationId");
385 b.HasIndex(
"TestMergeId");
387 b.ToTable(
"RevInfoTestMerges");
390 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
392 b.Property<
long>(
"Id")
393 .ValueGeneratedOnAdd()
394 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
396 b.Property<
string>(
"CommitSha")
400 b.Property<
long>(
"InstanceId");
402 b.Property<
string>(
"OriginCommitSha")
408 b.HasIndex(
"CommitSha")
411 b.HasIndex(
"InstanceId");
413 b.ToTable(
"RevisionInformations");
416 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
418 b.Property<
long>(
"Id")
419 .ValueGeneratedOnAdd()
420 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
422 b.Property<
string>(
"Author")
425 b.Property<
string>(
"BodyAtMerge")
428 b.Property<
string>(
"Comment");
430 b.Property<DateTimeOffset>(
"MergedAt");
432 b.Property<
long>(
"MergedById");
434 b.Property<
int?>(
"Number")
437 b.Property<
long?>(
"PrimaryRevisionInformationId");
439 b.Property<
string>(
"PullRequestRevision")
442 b.Property<
string>(
"TitleAtMerge")
445 b.Property<
string>(
"Url")
450 b.HasIndex(
"MergedById");
452 b.HasIndex(
"PrimaryRevisionInformationId")
454 .HasFilter(
"[PrimaryRevisionInformationId] IS NOT NULL");
456 b.ToTable(
"TestMerges");
459 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
461 b.Property<
long>(
"Id")
462 .ValueGeneratedOnAdd()
463 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
465 b.Property<decimal>(
"AdministrationRights")
466 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
468 b.Property<
string>(
"CanonicalName")
471 b.Property<DateTimeOffset?>(
"CreatedAt")
474 b.Property<
long?>(
"CreatedById");
476 b.Property<
bool?>(
"Enabled")
479 b.Property<decimal>(
"InstanceManagerRights")
480 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
482 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
484 b.Property<
string>(
"Name")
487 b.Property<
string>(
"PasswordHash");
489 b.Property<
string>(
"SystemIdentifier");
493 b.HasIndex(
"CanonicalName")
496 b.HasIndex(
"CreatedById");
501 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
503 b.Property<
long>(
"Id")
504 .ValueGeneratedOnAdd()
505 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
507 b.Property<
long?>(
"AlphaId");
509 b.Property<
bool>(
"AlphaIsActive");
511 b.Property<
long?>(
"BravoId");
515 b.HasIndex(
"AlphaId");
517 b.HasIndex(
"BravoId");
519 b.ToTable(
"WatchdogReattachInformations");
522 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
524 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
525 .WithMany(
"ChatSettings")
526 .HasForeignKey(
"InstanceId")
527 .OnDelete(DeleteBehavior.Cascade);
530 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
532 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
533 .WithMany(
"Channels")
534 .HasForeignKey(
"ChatSettingsId")
535 .OnDelete(DeleteBehavior.Cascade);
538 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
540 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
542 .HasForeignKey(
"JobId");
544 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
545 .WithMany(
"CompileJobs")
546 .HasForeignKey(
"RevisionInformationId")
547 .OnDelete(DeleteBehavior.Cascade);
550 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
552 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
553 .WithOne(
"DreamDaemonSettings")
554 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
555 .OnDelete(DeleteBehavior.Cascade);
558 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
560 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
561 .WithOne(
"DreamMakerSettings")
562 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
563 .OnDelete(DeleteBehavior.Cascade);
566 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
568 b.HasOne(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"WatchdogReattachInformation")
570 .HasForeignKey(
"WatchdogReattachInformationId");
573 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
575 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
576 .WithMany(
"InstanceUsers")
577 .HasForeignKey(
"InstanceId")
578 .OnDelete(DeleteBehavior.Cascade);
580 b.HasOne(
"Tgstation.Server.Host.Models.User")
581 .WithMany(
"InstanceUsers")
582 .HasForeignKey(
"UserId")
583 .OnDelete(DeleteBehavior.Cascade);
586 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
588 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
590 .HasForeignKey(
"CancelledById");
592 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
594 .HasForeignKey(
"InstanceId")
595 .OnDelete(DeleteBehavior.Cascade);
597 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
599 .HasForeignKey(
"StartedById")
600 .OnDelete(DeleteBehavior.Cascade);
603 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
605 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
607 .HasForeignKey(
"CompileJobId");
610 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
612 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
613 .WithOne(
"RepositorySettings")
614 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
615 .OnDelete(DeleteBehavior.Cascade);
618 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
620 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
621 .WithMany(
"ActiveTestMerges")
622 .HasForeignKey(
"RevisionInformationId")
623 .OnDelete(DeleteBehavior.Cascade);
625 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
626 .WithMany(
"RevisonInformations")
627 .HasForeignKey(
"TestMergeId")
628 .OnDelete(DeleteBehavior.Cascade);
631 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
633 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
634 .WithMany(
"RevisionInformations")
635 .HasForeignKey(
"InstanceId")
636 .OnDelete(DeleteBehavior.Cascade);
639 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
641 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
642 .WithMany(
"TestMerges")
643 .HasForeignKey(
"MergedById")
644 .OnDelete(DeleteBehavior.Restrict);
646 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
647 .WithOne(
"PrimaryTestMerge")
648 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
649 .OnDelete(DeleteBehavior.SetNull);
652 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
654 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
655 .WithMany(
"CreatedUsers")
656 .HasForeignKey(
"CreatedById");
659 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
661 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
663 .HasForeignKey(
"AlphaId");
665 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
667 .HasForeignKey(
"BravoId");
669#pragma warning restore 612, 618