17#pragma warning disable 612, 618
19 .HasAnnotation(
"ProductVersion",
"3.1.5")
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<
long>(
"JobId")
138 .HasColumnType(
"bigint");
140 b.Property<
int?>(
"MinimumSecurityLevel")
141 .HasColumnType(
"int");
143 b.Property<
string>(
"Output")
145 .HasColumnType(
"nvarchar(max)");
147 b.Property<
long>(
"RevisionInformationId")
148 .HasColumnType(
"bigint");
152 b.HasIndex(
"DirectoryName");
157 b.HasIndex(
"RevisionInformationId");
159 b.ToTable(
"CompileJobs");
162 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
164 b.Property<
long>(
"Id")
165 .ValueGeneratedOnAdd()
166 .HasColumnType(
"bigint")
167 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
169 b.Property<
bool?>(
"AllowWebClient")
171 .HasColumnType(
"bit");
173 b.Property<
bool?>(
"AutoStart")
175 .HasColumnType(
"bit");
177 b.Property<
long>(
"HeartbeatSeconds")
178 .HasColumnType(
"bigint");
180 b.Property<
long>(
"InstanceId")
181 .HasColumnType(
"bigint");
183 b.Property<
int>(
"Port")
184 .HasColumnType(
"int");
186 b.Property<
int>(
"SecurityLevel")
187 .HasColumnType(
"int");
189 b.Property<
long>(
"StartupTimeout")
190 .HasColumnType(
"bigint");
192 b.Property<
long>(
"TopicRequestTimeout")
193 .HasColumnType(
"bigint");
197 b.HasIndex(
"InstanceId")
200 b.ToTable(
"DreamDaemonSettings");
203 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
205 b.Property<
long>(
"Id")
206 .ValueGeneratedOnAdd()
207 .HasColumnType(
"bigint")
208 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
210 b.Property<
int>(
"ApiValidationPort")
211 .HasColumnType(
"int");
213 b.Property<
int>(
"ApiValidationSecurityLevel")
214 .HasColumnType(
"int");
216 b.Property<
long>(
"InstanceId")
217 .HasColumnType(
"bigint");
219 b.Property<
string>(
"ProjectName")
220 .HasColumnType(
"nvarchar(max)")
221 .HasMaxLength(10000);
223 b.Property<
bool?>(
"RequireDMApiValidation")
225 .HasColumnType(
"bit");
229 b.HasIndex(
"InstanceId")
232 b.ToTable(
"DreamMakerSettings");
235 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
237 b.Property<
long>(
"Id")
238 .ValueGeneratedOnAdd()
239 .HasColumnType(
"bigint")
240 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
242 b.Property<
long>(
"AutoUpdateInterval")
243 .HasColumnType(
"bigint");
245 b.Property<
int>(
"ChatBotLimit")
246 .HasColumnType(
"int");
248 b.Property<
int>(
"ConfigurationType")
249 .HasColumnType(
"int");
251 b.Property<
string>(
"Name")
253 .HasColumnType(
"nvarchar(max)")
254 .HasMaxLength(10000);
256 b.Property<
bool?>(
"Online")
258 .HasColumnType(
"bit");
260 b.Property<
string>(
"Path")
262 .HasColumnType(
"nvarchar(450)");
269 b.ToTable(
"Instances");
272 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
274 b.Property<
long>(
"Id")
275 .ValueGeneratedOnAdd()
276 .HasColumnType(
"bigint")
277 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
279 b.Property<decimal>(
"ByondRights")
280 .HasColumnType(
"decimal(20,0)");
282 b.Property<decimal>(
"ChatBotRights")
283 .HasColumnType(
"decimal(20,0)");
285 b.Property<decimal>(
"ConfigurationRights")
286 .HasColumnType(
"decimal(20,0)");
288 b.Property<decimal>(
"DreamDaemonRights")
289 .HasColumnType(
"decimal(20,0)");
291 b.Property<decimal>(
"DreamMakerRights")
292 .HasColumnType(
"decimal(20,0)");
294 b.Property<
long>(
"InstanceId")
295 .HasColumnType(
"bigint");
297 b.Property<decimal>(
"InstanceUserRights")
298 .HasColumnType(
"decimal(20,0)");
300 b.Property<decimal>(
"RepositoryRights")
301 .HasColumnType(
"decimal(20,0)");
303 b.Property<
long?>(
"UserId")
305 .HasColumnType(
"bigint");
309 b.HasIndex(
"InstanceId");
311 b.HasIndex(
"UserId",
"InstanceId")
314 b.ToTable(
"InstanceUsers");
317 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
319 b.Property<
long>(
"Id")
320 .ValueGeneratedOnAdd()
321 .HasColumnType(
"bigint")
322 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
324 b.Property<decimal?>(
"CancelRight")
325 .HasColumnType(
"decimal(20,0)");
327 b.Property<decimal?>(
"CancelRightsType")
328 .HasColumnType(
"decimal(20,0)");
330 b.Property<
bool?>(
"Cancelled")
332 .HasColumnType(
"bit");
334 b.Property<
long?>(
"CancelledById")
335 .HasColumnType(
"bigint");
337 b.Property<
string>(
"Description")
339 .HasColumnType(
"nvarchar(max)");
341 b.Property<
long?>(
"ErrorCode")
342 .HasColumnType(
"bigint");
344 b.Property<
string>(
"ExceptionDetails")
345 .HasColumnType(
"nvarchar(max)");
347 b.Property<
long>(
"InstanceId")
348 .HasColumnType(
"bigint");
350 b.Property<DateTimeOffset?>(
"StartedAt")
352 .HasColumnType(
"datetimeoffset");
354 b.Property<
long>(
"StartedById")
355 .HasColumnType(
"bigint");
357 b.Property<DateTimeOffset?>(
"StoppedAt")
358 .HasColumnType(
"datetimeoffset");
362 b.HasIndex(
"CancelledById");
364 b.HasIndex(
"InstanceId");
366 b.HasIndex(
"StartedById");
371 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
373 b.Property<
long>(
"Id")
374 .ValueGeneratedOnAdd()
375 .HasColumnType(
"bigint")
376 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
378 b.Property<
string>(
"AccessIdentifier")
380 .HasColumnType(
"nvarchar(max)");
382 b.Property<
long>(
"CompileJobId")
383 .HasColumnType(
"bigint");
385 b.Property<
int>(
"LaunchSecurityLevel")
386 .HasColumnType(
"int");
388 b.Property<
int>(
"Port")
389 .HasColumnType(
"int");
391 b.Property<
int>(
"ProcessId")
392 .HasColumnType(
"int");
394 b.Property<
int>(
"RebootState")
395 .HasColumnType(
"int");
399 b.HasIndex(
"CompileJobId");
401 b.ToTable(
"ReattachInformations");
404 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
406 b.Property<
long>(
"Id")
407 .ValueGeneratedOnAdd()
408 .HasColumnType(
"bigint")
409 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
411 b.Property<
string>(
"AccessToken")
412 .HasColumnType(
"nvarchar(max)")
413 .HasMaxLength(10000);
415 b.Property<
string>(
"AccessUser")
416 .HasColumnType(
"nvarchar(max)")
417 .HasMaxLength(10000);
419 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
421 .HasColumnType(
"bit");
423 b.Property<
bool?>(
"AutoUpdatesSynchronize")
425 .HasColumnType(
"bit");
427 b.Property<
string>(
"CommitterEmail")
429 .HasColumnType(
"nvarchar(max)")
430 .HasMaxLength(10000);
432 b.Property<
string>(
"CommitterName")
434 .HasColumnType(
"nvarchar(max)")
435 .HasMaxLength(10000);
437 b.Property<
long>(
"InstanceId")
438 .HasColumnType(
"bigint");
440 b.Property<
bool?>(
"PostTestMergeComment")
442 .HasColumnType(
"bit");
444 b.Property<
bool?>(
"PushTestMergeCommits")
446 .HasColumnType(
"bit");
448 b.Property<
bool?>(
"ShowTestMergeCommitters")
450 .HasColumnType(
"bit");
454 b.HasIndex(
"InstanceId")
457 b.ToTable(
"RepositorySettings");
460 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
462 b.Property<
long>(
"Id")
463 .ValueGeneratedOnAdd()
464 .HasColumnType(
"bigint")
465 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
467 b.Property<
long>(
"RevisionInformationId")
468 .HasColumnType(
"bigint");
470 b.Property<
long>(
"TestMergeId")
471 .HasColumnType(
"bigint");
475 b.HasIndex(
"RevisionInformationId");
477 b.HasIndex(
"TestMergeId");
479 b.ToTable(
"RevInfoTestMerges");
482 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
484 b.Property<
long>(
"Id")
485 .ValueGeneratedOnAdd()
486 .HasColumnType(
"bigint")
487 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
489 b.Property<
string>(
"CommitSha")
491 .HasColumnType(
"nvarchar(40)")
494 b.Property<
long>(
"InstanceId")
495 .HasColumnType(
"bigint");
497 b.Property<
string>(
"OriginCommitSha")
499 .HasColumnType(
"nvarchar(40)")
504 b.HasIndex(
"InstanceId",
"CommitSha")
507 b.ToTable(
"RevisionInformations");
510 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
512 b.Property<
long>(
"Id")
513 .ValueGeneratedOnAdd()
514 .HasColumnType(
"bigint")
515 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
517 b.Property<
string>(
"Author")
519 .HasColumnType(
"nvarchar(max)");
521 b.Property<
string>(
"BodyAtMerge")
523 .HasColumnType(
"nvarchar(max)");
525 b.Property<
string>(
"Comment")
526 .HasColumnType(
"nvarchar(max)")
527 .HasMaxLength(10000);
529 b.Property<DateTimeOffset>(
"MergedAt")
530 .HasColumnType(
"datetimeoffset");
532 b.Property<
long>(
"MergedById")
533 .HasColumnType(
"bigint");
535 b.Property<
int>(
"Number")
536 .HasColumnType(
"int");
538 b.Property<
long?>(
"PrimaryRevisionInformationId")
540 .HasColumnType(
"bigint");
542 b.Property<
string>(
"PullRequestRevision")
544 .HasColumnType(
"nvarchar(40)")
547 b.Property<
string>(
"TitleAtMerge")
549 .HasColumnType(
"nvarchar(max)");
551 b.Property<
string>(
"Url")
553 .HasColumnType(
"nvarchar(max)");
557 b.HasIndex(
"MergedById");
559 b.HasIndex(
"PrimaryRevisionInformationId")
562 b.ToTable(
"TestMerges");
565 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
567 b.Property<
long?>(
"Id")
568 .ValueGeneratedOnAdd()
569 .HasColumnType(
"bigint")
570 .HasAnnotation(
"SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
572 b.Property<decimal>(
"AdministrationRights")
573 .HasColumnType(
"decimal(20,0)");
575 b.Property<
string>(
"CanonicalName")
577 .HasColumnType(
"nvarchar(450)");
579 b.Property<DateTimeOffset?>(
"CreatedAt")
581 .HasColumnType(
"datetimeoffset");
583 b.Property<
long?>(
"CreatedById")
584 .HasColumnType(
"bigint");
586 b.Property<
bool?>(
"Enabled")
588 .HasColumnType(
"bit");
590 b.Property<decimal>(
"InstanceManagerRights")
591 .HasColumnType(
"decimal(20,0)");
593 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
594 .HasColumnType(
"datetimeoffset");
596 b.Property<
string>(
"Name")
598 .HasColumnType(
"nvarchar(max)")
599 .HasMaxLength(10000);
601 b.Property<
string>(
"PasswordHash")
602 .HasColumnType(
"nvarchar(max)");
604 b.Property<
string>(
"SystemIdentifier")
605 .HasColumnType(
"nvarchar(450)");
609 b.HasIndex(
"CanonicalName")
612 b.HasIndex(
"CreatedById");
614 b.HasIndex(
"SystemIdentifier")
616 .HasFilter(
"[SystemIdentifier] IS NOT NULL");
621 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
623 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
624 .WithMany(
"ChatSettings")
625 .HasForeignKey(
"InstanceId")
626 .OnDelete(DeleteBehavior.Cascade)
630 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
632 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
633 .WithMany(
"Channels")
634 .HasForeignKey(
"ChatSettingsId")
635 .OnDelete(DeleteBehavior.Cascade)
639 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
641 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
643 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
644 .OnDelete(DeleteBehavior.Cascade)
647 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
648 .WithMany(
"CompileJobs")
649 .HasForeignKey(
"RevisionInformationId")
650 .OnDelete(DeleteBehavior.ClientNoAction)
654 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
656 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
657 .WithOne(
"DreamDaemonSettings")
658 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
659 .OnDelete(DeleteBehavior.Cascade)
663 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
665 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
666 .WithOne(
"DreamMakerSettings")
667 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
668 .OnDelete(DeleteBehavior.Cascade)
672 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
674 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
675 .WithMany(
"InstanceUsers")
676 .HasForeignKey(
"InstanceId")
677 .OnDelete(DeleteBehavior.Cascade)
680 b.HasOne(
"Tgstation.Server.Host.Models.User",
null)
681 .WithMany(
"InstanceUsers")
682 .HasForeignKey(
"UserId")
683 .OnDelete(DeleteBehavior.Cascade)
687 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
689 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
691 .HasForeignKey(
"CancelledById");
693 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
695 .HasForeignKey(
"InstanceId")
696 .OnDelete(DeleteBehavior.Cascade)
699 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
701 .HasForeignKey(
"StartedById")
702 .OnDelete(DeleteBehavior.Cascade)
706 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
708 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
710 .HasForeignKey(
"CompileJobId")
711 .OnDelete(DeleteBehavior.Cascade)
715 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
717 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
718 .WithOne(
"RepositorySettings")
719 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
720 .OnDelete(DeleteBehavior.Cascade)
724 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
726 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
727 .WithMany(
"ActiveTestMerges")
728 .HasForeignKey(
"RevisionInformationId")
729 .OnDelete(DeleteBehavior.Cascade)
732 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
733 .WithMany(
"RevisonInformations")
734 .HasForeignKey(
"TestMergeId")
735 .OnDelete(DeleteBehavior.ClientNoAction)
739 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
741 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
742 .WithMany(
"RevisionInformations")
743 .HasForeignKey(
"InstanceId")
744 .OnDelete(DeleteBehavior.Cascade)
748 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
750 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
751 .WithMany(
"TestMerges")
752 .HasForeignKey(
"MergedById")
753 .OnDelete(DeleteBehavior.Restrict)
756 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
757 .WithOne(
"PrimaryTestMerge")
758 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
759 .OnDelete(DeleteBehavior.Cascade)
763 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
765 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
766 .WithMany(
"CreatedUsers")
767 .HasForeignKey(
"CreatedById");
769#pragma warning restore 612, 618