17#pragma warning disable 612, 618
19 .HasAnnotation(
"ProductVersion",
"3.1.6")
20 .HasAnnotation(
"Relational:MaxIdentifierLength", 128)
21 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
23 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
25 b.Property<
long>(
"Id")
26 .ValueGeneratedOnAdd()
27 .HasColumnType(
"bigint")
28 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
30 b.Property<
int>(
"ChannelLimit")
31 .HasColumnType(
"int");
33 b.Property<
string>(
"ConnectionString")
35 .HasColumnType(
"nvarchar(max)")
38 b.Property<
bool?>(
"Enabled")
39 .HasColumnType(
"bit");
41 b.Property<
long>(
"InstanceId")
42 .HasColumnType(
"bigint");
44 b.Property<
string>(
"Name")
46 .HasColumnType(
"nvarchar(100)")
49 b.Property<
int>(
"Provider")
50 .HasColumnType(
"int");
52 b.Property<
long>(
"ReconnectionInterval")
53 .HasColumnType(
"bigint");
57 b.HasIndex(
"InstanceId",
"Name")
60 b.ToTable(
"ChatBots");
63 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
65 b.Property<
long>(
"Id")
66 .ValueGeneratedOnAdd()
67 .HasColumnType(
"bigint")
68 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
70 b.Property<
long>(
"ChatSettingsId")
71 .HasColumnType(
"bigint");
73 b.Property<decimal?>(
"DiscordChannelId")
74 .HasColumnType(
"decimal(20,0)");
76 b.Property<
string>(
"IrcChannel")
77 .HasColumnType(
"nvarchar(100)")
80 b.Property<
bool?>(
"IsAdminChannel")
82 .HasColumnType(
"bit");
84 b.Property<
bool?>(
"IsUpdatesChannel")
86 .HasColumnType(
"bit");
88 b.Property<
bool?>(
"IsWatchdogChannel")
90 .HasColumnType(
"bit");
92 b.Property<
string>(
"Tag")
93 .HasColumnType(
"nvarchar(max)")
98 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
100 .HasFilter(
"[DiscordChannelId] IS NOT NULL");
102 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
104 .HasFilter(
"[IrcChannel] IS NOT NULL");
106 b.ToTable(
"ChatChannels");
109 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
111 b.Property<
long>(
"Id")
112 .ValueGeneratedOnAdd()
113 .HasColumnType(
"bigint")
114 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
116 b.Property<
string>(
"ByondVersion")
118 .HasColumnType(
"nvarchar(max)");
120 b.Property<
int?>(
"DMApiMajorVersion")
121 .HasColumnType(
"int");
123 b.Property<
int?>(
"DMApiMinorVersion")
124 .HasColumnType(
"int");
126 b.Property<
int?>(
"DMApiPatchVersion")
127 .HasColumnType(
"int");
129 b.Property<Guid?>(
"DirectoryName")
131 .HasColumnType(
"uniqueidentifier");
133 b.Property<
string>(
"DmeName")
135 .HasColumnType(
"nvarchar(max)");
137 b.Property<
int?>(
"GitHubDeploymentId")
138 .HasColumnType(
"int");
140 b.Property<
long?>(
"GitHubRepoId")
141 .HasColumnType(
"bigint");
143 b.Property<
long>(
"JobId")
144 .HasColumnType(
"bigint");
146 b.Property<
int?>(
"MinimumSecurityLevel")
147 .HasColumnType(
"int");
149 b.Property<
string>(
"Output")
151 .HasColumnType(
"nvarchar(max)");
153 b.Property<
long>(
"RevisionInformationId")
154 .HasColumnType(
"bigint");
158 b.HasIndex(
"DirectoryName");
163 b.HasIndex(
"RevisionInformationId");
165 b.ToTable(
"CompileJobs");
168 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
170 b.Property<
long>(
"Id")
171 .ValueGeneratedOnAdd()
172 .HasColumnType(
"bigint")
173 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
175 b.Property<
bool?>(
"AllowWebClient")
177 .HasColumnType(
"bit");
179 b.Property<
bool?>(
"AutoStart")
181 .HasColumnType(
"bit");
183 b.Property<
long>(
"HeartbeatSeconds")
184 .HasColumnType(
"bigint");
186 b.Property<
long>(
"InstanceId")
187 .HasColumnType(
"bigint");
189 b.Property<
int>(
"Port")
190 .HasColumnType(
"int");
192 b.Property<
int>(
"SecurityLevel")
193 .HasColumnType(
"int");
195 b.Property<
long>(
"StartupTimeout")
196 .HasColumnType(
"bigint");
198 b.Property<
long>(
"TopicRequestTimeout")
199 .HasColumnType(
"bigint");
203 b.HasIndex(
"InstanceId")
206 b.ToTable(
"DreamDaemonSettings");
209 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
211 b.Property<
long>(
"Id")
212 .ValueGeneratedOnAdd()
213 .HasColumnType(
"bigint")
214 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
216 b.Property<
int>(
"ApiValidationPort")
217 .HasColumnType(
"int");
219 b.Property<
int>(
"ApiValidationSecurityLevel")
220 .HasColumnType(
"int");
222 b.Property<
long>(
"InstanceId")
223 .HasColumnType(
"bigint");
225 b.Property<
string>(
"ProjectName")
226 .HasColumnType(
"nvarchar(max)")
227 .HasMaxLength(10000);
229 b.Property<
bool?>(
"RequireDMApiValidation")
231 .HasColumnType(
"bit");
235 b.HasIndex(
"InstanceId")
238 b.ToTable(
"DreamMakerSettings");
241 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
243 b.Property<
long>(
"Id")
244 .ValueGeneratedOnAdd()
245 .HasColumnType(
"bigint")
246 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
248 b.Property<
long>(
"AutoUpdateInterval")
249 .HasColumnType(
"bigint");
251 b.Property<
int>(
"ChatBotLimit")
252 .HasColumnType(
"int");
254 b.Property<
int>(
"ConfigurationType")
255 .HasColumnType(
"int");
257 b.Property<
string>(
"Name")
259 .HasColumnType(
"nvarchar(max)")
260 .HasMaxLength(10000);
262 b.Property<
bool?>(
"Online")
264 .HasColumnType(
"bit");
266 b.Property<
string>(
"Path")
268 .HasColumnType(
"nvarchar(450)");
275 b.ToTable(
"Instances");
278 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
280 b.Property<
long>(
"Id")
281 .ValueGeneratedOnAdd()
282 .HasColumnType(
"bigint")
283 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
285 b.Property<decimal>(
"ByondRights")
286 .HasColumnType(
"decimal(20,0)");
288 b.Property<decimal>(
"ChatBotRights")
289 .HasColumnType(
"decimal(20,0)");
291 b.Property<decimal>(
"ConfigurationRights")
292 .HasColumnType(
"decimal(20,0)");
294 b.Property<decimal>(
"DreamDaemonRights")
295 .HasColumnType(
"decimal(20,0)");
297 b.Property<decimal>(
"DreamMakerRights")
298 .HasColumnType(
"decimal(20,0)");
300 b.Property<
long>(
"InstanceId")
301 .HasColumnType(
"bigint");
303 b.Property<decimal>(
"InstanceUserRights")
304 .HasColumnType(
"decimal(20,0)");
306 b.Property<decimal>(
"RepositoryRights")
307 .HasColumnType(
"decimal(20,0)");
309 b.Property<
long>(
"UserId")
310 .HasColumnType(
"bigint");
314 b.HasIndex(
"InstanceId");
316 b.HasIndex(
"UserId",
"InstanceId")
319 b.ToTable(
"InstanceUsers");
322 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
324 b.Property<
long>(
"Id")
325 .ValueGeneratedOnAdd()
326 .HasColumnType(
"bigint")
327 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
329 b.Property<decimal?>(
"CancelRight")
330 .HasColumnType(
"decimal(20,0)");
332 b.Property<decimal?>(
"CancelRightsType")
333 .HasColumnType(
"decimal(20,0)");
335 b.Property<
bool?>(
"Cancelled")
337 .HasColumnType(
"bit");
339 b.Property<
long?>(
"CancelledById")
340 .HasColumnType(
"bigint");
342 b.Property<
string>(
"Description")
344 .HasColumnType(
"nvarchar(max)");
346 b.Property<
long?>(
"ErrorCode")
347 .HasColumnType(
"bigint");
349 b.Property<
string>(
"ExceptionDetails")
350 .HasColumnType(
"nvarchar(max)");
352 b.Property<
long>(
"InstanceId")
353 .HasColumnType(
"bigint");
355 b.Property<DateTimeOffset?>(
"StartedAt")
357 .HasColumnType(
"datetimeoffset");
359 b.Property<
long>(
"StartedById")
360 .HasColumnType(
"bigint");
362 b.Property<DateTimeOffset?>(
"StoppedAt")
363 .HasColumnType(
"datetimeoffset");
367 b.HasIndex(
"CancelledById");
369 b.HasIndex(
"InstanceId");
371 b.HasIndex(
"StartedById");
376 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
378 b.Property<
long>(
"Id")
379 .ValueGeneratedOnAdd()
380 .HasColumnType(
"bigint")
381 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
383 b.Property<
string>(
"AccessIdentifier")
385 .HasColumnType(
"nvarchar(max)");
387 b.Property<
long>(
"CompileJobId")
388 .HasColumnType(
"bigint");
390 b.Property<
int>(
"LaunchSecurityLevel")
391 .HasColumnType(
"int");
393 b.Property<
int>(
"Port")
394 .HasColumnType(
"int");
396 b.Property<
int>(
"ProcessId")
397 .HasColumnType(
"int");
399 b.Property<
int>(
"RebootState")
400 .HasColumnType(
"int");
404 b.HasIndex(
"CompileJobId");
406 b.ToTable(
"ReattachInformations");
409 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
411 b.Property<
long>(
"Id")
412 .ValueGeneratedOnAdd()
413 .HasColumnType(
"bigint")
414 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
416 b.Property<
string>(
"AccessToken")
417 .HasColumnType(
"nvarchar(max)")
418 .HasMaxLength(10000);
420 b.Property<
string>(
"AccessUser")
421 .HasColumnType(
"nvarchar(max)")
422 .HasMaxLength(10000);
424 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
426 .HasColumnType(
"bit");
428 b.Property<
bool?>(
"AutoUpdatesSynchronize")
430 .HasColumnType(
"bit");
432 b.Property<
string>(
"CommitterEmail")
434 .HasColumnType(
"nvarchar(max)")
435 .HasMaxLength(10000);
437 b.Property<
string>(
"CommitterName")
439 .HasColumnType(
"nvarchar(max)")
440 .HasMaxLength(10000);
442 b.Property<
bool?>(
"CreateGitHubDeployments")
444 .HasColumnType(
"bit");
446 b.Property<
long>(
"InstanceId")
447 .HasColumnType(
"bigint");
449 b.Property<
bool?>(
"PostTestMergeComment")
451 .HasColumnType(
"bit");
453 b.Property<
bool?>(
"PushTestMergeCommits")
455 .HasColumnType(
"bit");
457 b.Property<
bool?>(
"ShowTestMergeCommitters")
459 .HasColumnType(
"bit");
463 b.HasIndex(
"InstanceId")
466 b.ToTable(
"RepositorySettings");
469 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
471 b.Property<
long>(
"Id")
472 .ValueGeneratedOnAdd()
473 .HasColumnType(
"bigint")
474 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
476 b.Property<
long>(
"RevisionInformationId")
477 .HasColumnType(
"bigint");
479 b.Property<
long>(
"TestMergeId")
480 .HasColumnType(
"bigint");
484 b.HasIndex(
"RevisionInformationId");
486 b.HasIndex(
"TestMergeId");
488 b.ToTable(
"RevInfoTestMerges");
491 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
493 b.Property<
long>(
"Id")
494 .ValueGeneratedOnAdd()
495 .HasColumnType(
"bigint")
496 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
498 b.Property<
string>(
"CommitSha")
500 .HasColumnType(
"nvarchar(40)")
503 b.Property<
long>(
"InstanceId")
504 .HasColumnType(
"bigint");
506 b.Property<
string>(
"OriginCommitSha")
508 .HasColumnType(
"nvarchar(40)")
513 b.HasIndex(
"InstanceId",
"CommitSha")
516 b.ToTable(
"RevisionInformations");
519 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
521 b.Property<
long>(
"Id")
522 .ValueGeneratedOnAdd()
523 .HasColumnType(
"bigint")
524 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
526 b.Property<
string>(
"Author")
528 .HasColumnType(
"nvarchar(max)");
530 b.Property<
string>(
"BodyAtMerge")
532 .HasColumnType(
"nvarchar(max)");
534 b.Property<
string>(
"Comment")
535 .HasColumnType(
"nvarchar(max)")
536 .HasMaxLength(10000);
538 b.Property<DateTimeOffset>(
"MergedAt")
539 .HasColumnType(
"datetimeoffset");
541 b.Property<
long>(
"MergedById")
542 .HasColumnType(
"bigint");
544 b.Property<
int>(
"Number")
545 .HasColumnType(
"int");
547 b.Property<
long?>(
"PrimaryRevisionInformationId")
549 .HasColumnType(
"bigint");
551 b.Property<
string>(
"PullRequestRevision")
553 .HasColumnType(
"nvarchar(40)")
556 b.Property<
string>(
"TitleAtMerge")
558 .HasColumnType(
"nvarchar(max)");
560 b.Property<
string>(
"Url")
562 .HasColumnType(
"nvarchar(max)");
566 b.HasIndex(
"MergedById");
568 b.HasIndex(
"PrimaryRevisionInformationId")
571 b.ToTable(
"TestMerges");
574 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
576 b.Property<
long?>(
"Id")
577 .ValueGeneratedOnAdd()
578 .HasColumnType(
"bigint")
579 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
581 b.Property<decimal>(
"AdministrationRights")
582 .HasColumnType(
"decimal(20,0)");
584 b.Property<
string>(
"CanonicalName")
586 .HasColumnType(
"nvarchar(450)");
588 b.Property<DateTimeOffset?>(
"CreatedAt")
590 .HasColumnType(
"datetimeoffset");
592 b.Property<
long?>(
"CreatedById")
593 .HasColumnType(
"bigint");
595 b.Property<
bool?>(
"Enabled")
597 .HasColumnType(
"bit");
599 b.Property<decimal>(
"InstanceManagerRights")
600 .HasColumnType(
"decimal(20,0)");
602 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
603 .HasColumnType(
"datetimeoffset");
605 b.Property<
string>(
"Name")
607 .HasColumnType(
"nvarchar(max)")
608 .HasMaxLength(10000);
610 b.Property<
string>(
"PasswordHash")
611 .HasColumnType(
"nvarchar(max)");
613 b.Property<
string>(
"SystemIdentifier")
614 .HasColumnType(
"nvarchar(450)");
618 b.HasIndex(
"CanonicalName")
621 b.HasIndex(
"CreatedById");
623 b.HasIndex(
"SystemIdentifier")
625 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
630 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
632 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
633 .WithMany(
"ChatSettings")
634 .HasForeignKey(
"InstanceId")
635 .OnDelete(DeleteBehavior.Cascade)
639 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
641 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
642 .WithMany(
"Channels")
643 .HasForeignKey(
"ChatSettingsId")
644 .OnDelete(DeleteBehavior.Cascade)
648 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
650 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
652 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
653 .OnDelete(DeleteBehavior.Cascade)
656 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
657 .WithMany(
"CompileJobs")
658 .HasForeignKey(
"RevisionInformationId")
659 .OnDelete(DeleteBehavior.ClientNoAction)
663 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
665 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
666 .WithOne(
"DreamDaemonSettings")
667 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
668 .OnDelete(DeleteBehavior.Cascade)
672 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
674 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
675 .WithOne(
"DreamMakerSettings")
676 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
677 .OnDelete(DeleteBehavior.Cascade)
681 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
683 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
684 .WithMany(
"InstanceUsers")
685 .HasForeignKey(
"InstanceId")
686 .OnDelete(DeleteBehavior.Cascade)
689 b.HasOne(
"Tgstation.Server.Host.Models.User",
null)
690 .WithMany(
"InstanceUsers")
691 .HasForeignKey(
"UserId")
692 .OnDelete(DeleteBehavior.Cascade)
696 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
698 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
700 .HasForeignKey(
"CancelledById");
702 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
704 .HasForeignKey(
"InstanceId")
705 .OnDelete(DeleteBehavior.Cascade)
708 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
710 .HasForeignKey(
"StartedById")
711 .OnDelete(DeleteBehavior.Cascade)
715 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
717 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
719 .HasForeignKey(
"CompileJobId")
720 .OnDelete(DeleteBehavior.Cascade)
724 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
726 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
727 .WithOne(
"RepositorySettings")
728 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
729 .OnDelete(DeleteBehavior.Cascade)
733 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
735 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
736 .WithMany(
"ActiveTestMerges")
737 .HasForeignKey(
"RevisionInformationId")
738 .OnDelete(DeleteBehavior.Cascade)
741 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
742 .WithMany(
"RevisonInformations")
743 .HasForeignKey(
"TestMergeId")
744 .OnDelete(DeleteBehavior.ClientNoAction)
748 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
750 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
751 .WithMany(
"RevisionInformations")
752 .HasForeignKey(
"InstanceId")
753 .OnDelete(DeleteBehavior.Cascade)
757 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
759 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
760 .WithMany(
"TestMerges")
761 .HasForeignKey(
"MergedById")
762 .OnDelete(DeleteBehavior.Restrict)
765 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
766 .WithOne(
"PrimaryTestMerge")
767 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
768 .OnDelete(DeleteBehavior.Cascade)
772 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
774 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
775 .WithMany(
"CreatedUsers")
776 .HasForeignKey(
"CreatedById");
778#pragma warning restore 612, 618