18#pragma warning disable 612, 618
20 .HasAnnotation(
"ProductVersion",
"2.1.2-rtm-30932")
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<
string>(
"Output");
106 b.Property<
long>(
"RevisionInformationId");
110 b.HasIndex(
"DirectoryName");
114 b.HasIndex(
"RevisionInformationId");
116 b.ToTable(
"CompileJobs");
119 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
121 b.Property<
long>(
"Id")
122 .ValueGeneratedOnAdd()
123 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
125 b.Property<
string>(
"AccessToken");
127 b.Property<
bool?>(
"AllowWebClient")
130 b.Property<
bool?>(
"AutoStart")
133 b.Property<
long>(
"InstanceId");
135 b.Property<
int>(
"PrimaryPort");
137 b.Property<
int?>(
"ProcessId");
139 b.Property<
int>(
"SecondaryPort");
141 b.Property<
int>(
"SecurityLevel");
143 b.Property<
bool?>(
"SoftRestart")
146 b.Property<
bool?>(
"SoftShutdown")
149 b.Property<
long>(
"StartupTimeout");
153 b.HasIndex(
"InstanceId")
156 b.ToTable(
"DreamDaemonSettings");
159 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
161 b.Property<
long>(
"Id")
162 .ValueGeneratedOnAdd()
163 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
165 b.Property<
int>(
"ApiValidationPort");
167 b.Property<
long>(
"InstanceId");
169 b.Property<
string>(
"ProjectName");
173 b.HasIndex(
"InstanceId")
176 b.ToTable(
"DreamMakerSettings");
179 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
181 b.Property<
long>(
"Id")
182 .ValueGeneratedOnAdd()
183 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
185 b.Property<
long>(
"AutoUpdateInterval");
187 b.Property<
int>(
"ConfigurationType");
189 b.Property<
string>(
"Name")
192 b.Property<
bool?>(
"Online")
195 b.Property<
string>(
"Path")
198 b.Property<
long?>(
"WatchdogReattachInformationId");
205 b.HasIndex(
"WatchdogReattachInformationId");
207 b.ToTable(
"Instances");
210 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
212 b.Property<
long>(
"Id")
213 .ValueGeneratedOnAdd()
214 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
216 b.Property<decimal>(
"ByondRights")
217 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
219 b.Property<decimal>(
"ChatBotRights")
220 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
222 b.Property<decimal>(
"ConfigurationRights")
223 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
225 b.Property<decimal>(
"DreamDaemonRights")
226 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
228 b.Property<decimal>(
"DreamMakerRights")
229 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
231 b.Property<
long>(
"InstanceId");
233 b.Property<decimal>(
"InstanceUserRights")
234 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
236 b.Property<decimal>(
"RepositoryRights")
237 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
239 b.Property<
long?>(
"UserId")
244 b.HasIndex(
"InstanceId");
246 b.HasIndex(
"UserId",
"InstanceId")
249 b.ToTable(
"InstanceUsers");
252 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
254 b.Property<
long>(
"Id")
255 .ValueGeneratedOnAdd()
256 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
258 b.Property<decimal?>(
"CancelRight")
259 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
261 b.Property<decimal?>(
"CancelRightsType")
262 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
264 b.Property<
bool?>(
"Cancelled")
267 b.Property<
long?>(
"CancelledById");
269 b.Property<
string>(
"Description")
272 b.Property<
string>(
"ExceptionDetails");
274 b.Property<
long>(
"InstanceId");
276 b.Property<DateTimeOffset?>(
"StartedAt")
279 b.Property<
long>(
"StartedById");
281 b.Property<DateTimeOffset?>(
"StoppedAt");
285 b.HasIndex(
"CancelledById");
287 b.HasIndex(
"InstanceId");
289 b.HasIndex(
"StartedById");
294 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
296 b.Property<
long>(
"Id")
297 .ValueGeneratedOnAdd()
298 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
300 b.Property<
string>(
"AccessIdentifier")
303 b.Property<
string>(
"ChatChannelsJson")
306 b.Property<
string>(
"ChatCommandsJson")
309 b.Property<
long?>(
"CompileJobId");
311 b.Property<
bool>(
"IsPrimary");
313 b.Property<
int>(
"Port");
315 b.Property<
int>(
"ProcessId");
317 b.Property<
int>(
"RebootState");
319 b.Property<
string>(
"ServerCommandsJson")
324 b.HasIndex(
"CompileJobId");
326 b.ToTable(
"ReattachInformations");
329 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
331 b.Property<
long>(
"Id")
332 .ValueGeneratedOnAdd()
333 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
335 b.Property<
string>(
"AccessToken");
337 b.Property<
string>(
"AccessUser");
339 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
342 b.Property<
bool?>(
"AutoUpdatesSynchronize")
345 b.Property<
string>(
"CommitterEmail")
348 b.Property<
string>(
"CommitterName")
351 b.Property<
long>(
"InstanceId");
353 b.Property<
bool?>(
"PushTestMergeCommits")
356 b.Property<
bool?>(
"ShowTestMergeCommitters")
361 b.HasIndex(
"InstanceId")
364 b.ToTable(
"RepositorySettings");
367 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
369 b.Property<
long>(
"Id")
370 .ValueGeneratedOnAdd()
371 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
373 b.Property<
long>(
"RevisionInformationId");
375 b.Property<
long>(
"TestMergeId");
379 b.HasIndex(
"RevisionInformationId");
381 b.HasIndex(
"TestMergeId");
383 b.ToTable(
"RevInfoTestMerges");
386 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
388 b.Property<
long>(
"Id")
389 .ValueGeneratedOnAdd()
390 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
392 b.Property<
string>(
"CommitSha")
396 b.Property<
long>(
"InstanceId");
398 b.Property<
string>(
"OriginCommitSha")
404 b.HasIndex(
"CommitSha")
407 b.HasIndex(
"InstanceId");
409 b.ToTable(
"RevisionInformations");
412 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
414 b.Property<
long>(
"Id")
415 .ValueGeneratedOnAdd()
416 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
418 b.Property<
string>(
"Author")
421 b.Property<
string>(
"BodyAtMerge")
424 b.Property<
string>(
"Comment");
426 b.Property<DateTimeOffset>(
"MergedAt");
428 b.Property<
long>(
"MergedById");
430 b.Property<
int?>(
"Number")
433 b.Property<
long?>(
"PrimaryRevisionInformationId");
435 b.Property<
string>(
"PullRequestRevision")
438 b.Property<
string>(
"TitleAtMerge")
441 b.Property<
string>(
"Url")
446 b.HasIndex(
"MergedById");
448 b.HasIndex(
"PrimaryRevisionInformationId")
450 .HasFilter(
"[PrimaryRevisionInformationId] IS NOT NULL");
452 b.ToTable(
"TestMerges");
455 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
457 b.Property<
long>(
"Id")
458 .ValueGeneratedOnAdd()
459 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
461 b.Property<decimal>(
"AdministrationRights")
462 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
464 b.Property<
string>(
"CanonicalName")
467 b.Property<DateTimeOffset?>(
"CreatedAt")
470 b.Property<
long?>(
"CreatedById");
472 b.Property<
bool?>(
"Enabled")
475 b.Property<decimal>(
"InstanceManagerRights")
476 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
478 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
480 b.Property<
string>(
"Name")
483 b.Property<
string>(
"PasswordHash");
485 b.Property<
string>(
"SystemIdentifier");
489 b.HasIndex(
"CanonicalName")
492 b.HasIndex(
"CreatedById");
497 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
499 b.Property<
long>(
"Id")
500 .ValueGeneratedOnAdd()
501 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
503 b.Property<
long?>(
"AlphaId");
505 b.Property<
bool>(
"AlphaIsActive");
507 b.Property<
long?>(
"BravoId");
511 b.HasIndex(
"AlphaId");
513 b.HasIndex(
"BravoId");
515 b.ToTable(
"WatchdogReattachInformations");
518 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
520 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
521 .WithMany(
"ChatSettings")
522 .HasForeignKey(
"InstanceId")
523 .OnDelete(DeleteBehavior.Cascade);
526 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
528 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
529 .WithMany(
"Channels")
530 .HasForeignKey(
"ChatSettingsId")
531 .OnDelete(DeleteBehavior.Cascade);
534 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
536 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
538 .HasForeignKey(
"JobId");
540 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
541 .WithMany(
"CompileJobs")
542 .HasForeignKey(
"RevisionInformationId")
543 .OnDelete(DeleteBehavior.Cascade);
546 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
548 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
549 .WithOne(
"DreamDaemonSettings")
550 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
551 .OnDelete(DeleteBehavior.Cascade);
554 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
556 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
557 .WithOne(
"DreamMakerSettings")
558 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
559 .OnDelete(DeleteBehavior.Cascade);
562 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
564 b.HasOne(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"WatchdogReattachInformation")
566 .HasForeignKey(
"WatchdogReattachInformationId");
569 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
571 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
572 .WithMany(
"InstanceUsers")
573 .HasForeignKey(
"InstanceId")
574 .OnDelete(DeleteBehavior.Cascade);
576 b.HasOne(
"Tgstation.Server.Host.Models.User")
577 .WithMany(
"InstanceUsers")
578 .HasForeignKey(
"UserId")
579 .OnDelete(DeleteBehavior.Cascade);
582 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
584 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
586 .HasForeignKey(
"CancelledById");
588 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
590 .HasForeignKey(
"InstanceId")
591 .OnDelete(DeleteBehavior.Cascade);
593 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
595 .HasForeignKey(
"StartedById")
596 .OnDelete(DeleteBehavior.Cascade);
599 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
601 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
603 .HasForeignKey(
"CompileJobId");
606 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
608 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
609 .WithOne(
"RepositorySettings")
610 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
611 .OnDelete(DeleteBehavior.Cascade);
614 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
616 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
617 .WithMany(
"ActiveTestMerges")
618 .HasForeignKey(
"RevisionInformationId")
619 .OnDelete(DeleteBehavior.Cascade);
621 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
622 .WithMany(
"RevisonInformations")
623 .HasForeignKey(
"TestMergeId")
624 .OnDelete(DeleteBehavior.Cascade);
627 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
629 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
630 .WithMany(
"RevisionInformations")
631 .HasForeignKey(
"InstanceId")
632 .OnDelete(DeleteBehavior.Cascade);
635 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
637 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
638 .WithMany(
"TestMerges")
639 .HasForeignKey(
"MergedById")
640 .OnDelete(DeleteBehavior.Restrict);
642 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
643 .WithOne(
"PrimaryTestMerge")
644 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
645 .OnDelete(DeleteBehavior.SetNull);
648 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
650 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
651 .WithMany(
"CreatedUsers")
652 .HasForeignKey(
"CreatedById");
655 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
657 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
659 .HasForeignKey(
"AlphaId");
661 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
663 .HasForeignKey(
"BravoId");
665#pragma warning restore 612, 618