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(
"InstanceId",
"CommitSha")
414 b.ToTable(
"RevisionInformations");
417 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
419 b.Property<
long>(
"Id")
420 .ValueGeneratedOnAdd()
421 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
423 b.Property<
string>(
"Author")
426 b.Property<
string>(
"BodyAtMerge")
429 b.Property<
string>(
"Comment");
431 b.Property<DateTimeOffset>(
"MergedAt");
433 b.Property<
long>(
"MergedById");
435 b.Property<
int?>(
"Number")
438 b.Property<
long?>(
"PrimaryRevisionInformationId")
441 b.Property<
string>(
"PullRequestRevision")
444 b.Property<
string>(
"TitleAtMerge")
447 b.Property<
string>(
"Url")
452 b.HasIndex(
"MergedById");
454 b.HasIndex(
"PrimaryRevisionInformationId")
457 b.ToTable(
"TestMerges");
460 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
462 b.Property<
long>(
"Id")
463 .ValueGeneratedOnAdd()
464 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
466 b.Property<decimal>(
"AdministrationRights")
467 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
469 b.Property<
string>(
"CanonicalName")
472 b.Property<DateTimeOffset?>(
"CreatedAt")
475 b.Property<
long?>(
"CreatedById");
477 b.Property<
bool?>(
"Enabled")
480 b.Property<decimal>(
"InstanceManagerRights")
481 .HasConversion(
new ValueConverter<decimal, decimal>(v =>
default(decimal), v =>
default(decimal),
new ConverterMappingHints(precision: 20, scale: 0)));
483 b.Property<DateTimeOffset?>(
"LastPasswordUpdate");
485 b.Property<
string>(
"Name")
488 b.Property<
string>(
"PasswordHash");
490 b.Property<
string>(
"SystemIdentifier");
494 b.HasIndex(
"CanonicalName")
497 b.HasIndex(
"CreatedById");
502 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
504 b.Property<
long>(
"Id")
505 .ValueGeneratedOnAdd()
506 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
508 b.Property<
long?>(
"AlphaId");
510 b.Property<
bool>(
"AlphaIsActive");
512 b.Property<
long?>(
"BravoId");
514 b.Property<
long>(
"InstanceId");
518 b.HasIndex(
"AlphaId");
520 b.HasIndex(
"BravoId");
522 b.HasIndex(
"InstanceId")
525 b.ToTable(
"WatchdogReattachInformations");
528 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
530 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
531 .WithMany(
"ChatSettings")
532 .HasForeignKey(
"InstanceId")
533 .OnDelete(DeleteBehavior.Cascade);
536 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
538 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
539 .WithMany(
"Channels")
540 .HasForeignKey(
"ChatSettingsId")
541 .OnDelete(DeleteBehavior.Cascade);
544 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
546 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
548 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
549 .OnDelete(DeleteBehavior.Restrict);
551 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
552 .WithMany(
"CompileJobs")
553 .HasForeignKey(
"RevisionInformationId")
554 .OnDelete(DeleteBehavior.Cascade);
557 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
559 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
560 .WithOne(
"DreamDaemonSettings")
561 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
562 .OnDelete(DeleteBehavior.Cascade);
565 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
567 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
568 .WithOne(
"DreamMakerSettings")
569 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
570 .OnDelete(DeleteBehavior.Cascade);
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")
608 .OnDelete(DeleteBehavior.Cascade);
611 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
613 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
614 .WithOne(
"RepositorySettings")
615 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
616 .OnDelete(DeleteBehavior.Cascade);
619 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
621 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
622 .WithMany(
"ActiveTestMerges")
623 .HasForeignKey(
"RevisionInformationId")
624 .OnDelete(DeleteBehavior.Cascade);
626 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
627 .WithMany(
"RevisonInformations")
628 .HasForeignKey(
"TestMergeId")
629 .OnDelete(DeleteBehavior.Cascade);
632 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
634 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
635 .WithMany(
"RevisionInformations")
636 .HasForeignKey(
"InstanceId")
637 .OnDelete(DeleteBehavior.Cascade);
640 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
642 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
643 .WithMany(
"TestMerges")
644 .HasForeignKey(
"MergedById")
645 .OnDelete(DeleteBehavior.Restrict);
647 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
648 .WithOne(
"PrimaryTestMerge")
649 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
650 .OnDelete(DeleteBehavior.Restrict);
653 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
655 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
656 .WithMany(
"CreatedUsers")
657 .HasForeignKey(
"CreatedById");
660 modelBuilder.Entity(
"Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
662 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Alpha")
664 .HasForeignKey(
"AlphaId");
666 b.HasOne(
"Tgstation.Server.Host.Models.ReattachInformation",
"Bravo")
668 .HasForeignKey(
"BravoId");
670 b.HasOne(
"Tgstation.Server.Host.Models.Instance")
671 .WithOne(
"WatchdogReattachInformation")
672 .HasForeignKey(
"Tgstation.Server.Host.Models.WatchdogReattachInformation",
"InstanceId")
673 .OnDelete(DeleteBehavior.Cascade);
675#pragma warning restore 612, 618