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")
101 b.Property<
string>(
"DmeName")
104 b.Property<
long>(
"JobId");
106 b.Property<
int>(
"MinimumSecurityLevel");
108 b.Property<
string>(
"Output")
111 b.Property<
long>(
"RevisionInformationId");
115 b.HasIndex(
"DirectoryName");
120 b.HasIndex(
"RevisionInformationId");
122 b.ToTable(
"CompileJobs");
125 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
127 b.Property<
long>(
"Id")
128 .ValueGeneratedOnAdd()
129 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
131 b.Property<
string>(
"AccessToken");
133 b.Property<
bool?>(
"AllowWebClient")
136 b.Property<
bool?>(
"AutoStart")
139 b.Property<
long>(
"InstanceId");
141 b.Property<
int>(
"PrimaryPort");
143 b.Property<
int?>(
"ProcessId");
145 b.Property<
int>(
"SecondaryPort");
147 b.Property<
int>(
"SecurityLevel");
149 b.Property<
bool?>(
"SoftRestart")
152 b.Property<
bool?>(
"SoftShutdown")
155 b.Property<
long>(
"StartupTimeout");
159 b.HasIndex(
"InstanceId")
162 b.ToTable(
"DreamDaemonSettings");
165 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
167 b.Property<
long>(
"Id")
168 .ValueGeneratedOnAdd()
169 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
171 b.Property<
int>(
"ApiValidationPort");
173 b.Property<
int>(
"ApiValidationSecurityLevel");
175 b.Property<
long>(
"InstanceId");
177 b.Property<
string>(
"ProjectName");
181 b.HasIndex(
"InstanceId")
184 b.ToTable(
"DreamMakerSettings");
187 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
189 b.Property<
long>(
"Id")
190 .ValueGeneratedOnAdd()
191 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
193 b.Property<
long>(
"AutoUpdateInterval");
195 b.Property<
int>(
"ConfigurationType");
197 b.Property<
string>(
"Name")
200 b.Property<
bool?>(
"Online")
203 b.Property<
string>(
"Path")
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")
440 b.Property<
string>(
"PullRequestRevision")
443 b.Property<
string>(
"TitleAtMerge")
446 b.Property<
string>(
"Url")
451 b.HasIndex(
"MergedById");
453 b.HasIndex(
"PrimaryRevisionInformationId")
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");
513 b.Property<
long>(
"InstanceId");
517 b.HasIndex(
"AlphaId");
519 b.HasIndex(
"BravoId");
521 b.HasIndex(
"InstanceId")
524 b.ToTable(
"WatchdogReattachInformations");
527 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
529 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
530 .WithMany(
"ChatSettings")
531 .HasForeignKey(
"InstanceId")
532 .OnDelete(DeleteBehavior.Cascade);
535 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
537 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
538 .WithMany(
"Channels")
539 .HasForeignKey(
"ChatSettingsId")
540 .OnDelete(DeleteBehavior.Cascade);
543 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
545 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
547 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
548 .OnDelete(DeleteBehavior.Restrict);
550 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
551 .WithMany(
"CompileJobs")
552 .HasForeignKey(
"RevisionInformationId")
553 .OnDelete(DeleteBehavior.Cascade);
556 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
558 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
559 .WithOne(
"DreamDaemonSettings")
560 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
561 .OnDelete(DeleteBehavior.Cascade);
564 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
566 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
567 .WithOne(
"DreamMakerSettings")
568 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
569 .OnDelete(DeleteBehavior.Cascade);
572 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
574 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
575 .WithMany(
"InstanceUsers")
576 .HasForeignKey(
"InstanceId")
577 .OnDelete(DeleteBehavior.Cascade);
579 b.HasOne(
"Tgstation.Server.Host.Models.User")
580 .WithMany(
"InstanceUsers")
581 .HasForeignKey(
"UserId")
582 .OnDelete(DeleteBehavior.Cascade);
585 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
587 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
589 .HasForeignKey(
"CancelledById");
591 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
593 .HasForeignKey(
"InstanceId")
594 .OnDelete(DeleteBehavior.Cascade);
596 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
598 .HasForeignKey(
"StartedById")
599 .OnDelete(DeleteBehavior.Cascade);
602 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
604 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
606 .HasForeignKey(
"CompileJobId")
607 .OnDelete(DeleteBehavior.Cascade);
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.Restrict);
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 b.HasOne(
"Tgstation.Server.Host.Models.Instance")
670 .WithOne(
"WatchdogReattachInformation")
671 .HasForeignKey(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"InstanceId")
672 .OnDelete(DeleteBehavior.Cascade);
674#pragma warning restore 612, 618