18#pragma warning disable 612, 618
20 .HasAnnotation(
"ProductVersion",
"2.1.4-rtm-31024")
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?>(
"PostTestMergeComment")
360 b.Property<
bool?>(
"PushTestMergeCommits")
363 b.Property<
bool?>(
"ShowTestMergeCommitters")
368 b.HasIndex(
"InstanceId")
371 b.ToTable(
"RepositorySettings");
374 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
376 b.Property<
long>(
"Id")
377 .ValueGeneratedOnAdd()
378 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
380 b.Property<
long>(
"RevisionInformationId");
382 b.Property<
long>(
"TestMergeId");
386 b.HasIndex(
"RevisionInformationId");
388 b.HasIndex(
"TestMergeId");
390 b.ToTable(
"RevInfoTestMerges");
393 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
395 b.Property<
long>(
"Id")
396 .ValueGeneratedOnAdd()
397 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
399 b.Property<
string>(
"CommitSha")
403 b.Property<
long>(
"InstanceId");
405 b.Property<
string>(
"OriginCommitSha")
411 b.HasIndex(
"CommitSha")
414 b.HasIndex(
"InstanceId");
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