17#pragma warning disable 612, 618
19 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
20 .HasAnnotation(
"ProductVersion",
"3.1.5")
21 .HasAnnotation(
"Relational:MaxIdentifierLength", 63);
23 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
25 b.Property<
long>(
"Id")
26 .ValueGeneratedOnAdd()
27 .HasColumnType(
"bigint")
28 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
30 b.Property<
int>(
"ChannelLimit")
31 .HasColumnType(
"integer");
33 b.Property<
string>(
"ConnectionString")
35 .HasColumnType(
"character varying(10000)")
38 b.Property<
bool?>(
"Enabled")
39 .HasColumnType(
"boolean");
41 b.Property<
long>(
"InstanceId")
42 .HasColumnType(
"bigint");
44 b.Property<
string>(
"Name")
46 .HasColumnType(
"character varying(100)")
49 b.Property<
int>(
"Provider")
50 .HasColumnType(
"integer");
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(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
70 b.Property<
long>(
"ChatSettingsId")
71 .HasColumnType(
"bigint");
73 b.Property<decimal?>(
"DiscordChannelId")
74 .HasColumnType(
"numeric(20,0)");
76 b.Property<
string>(
"IrcChannel")
77 .HasColumnType(
"character varying(100)")
80 b.Property<
bool?>(
"IsAdminChannel")
82 .HasColumnType(
"boolean");
84 b.Property<
bool?>(
"IsUpdatesChannel")
86 .HasColumnType(
"boolean");
88 b.Property<
bool?>(
"IsWatchdogChannel")
90 .HasColumnType(
"boolean");
92 b.Property<
string>(
"Tag")
93 .HasColumnType(
"character varying(10000)")
98 b.HasIndex(
"ChatSettingsId",
"DiscordChannelId")
101 b.HasIndex(
"ChatSettingsId",
"IrcChannel")
104 b.ToTable(
"ChatChannels");
107 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
109 b.Property<
long>(
"Id")
110 .ValueGeneratedOnAdd()
111 .HasColumnType(
"bigint")
112 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
114 b.Property<
string>(
"ByondVersion")
116 .HasColumnType(
"text");
118 b.Property<
int?>(
"DMApiMajorVersion")
119 .HasColumnType(
"integer");
121 b.Property<
int?>(
"DMApiMinorVersion")
122 .HasColumnType(
"integer");
124 b.Property<
int?>(
"DMApiPatchVersion")
125 .HasColumnType(
"integer");
127 b.Property<Guid?>(
"DirectoryName")
129 .HasColumnType(
"uuid");
131 b.Property<
string>(
"DmeName")
133 .HasColumnType(
"text");
135 b.Property<
long>(
"JobId")
136 .HasColumnType(
"bigint");
138 b.Property<
int?>(
"MinimumSecurityLevel")
139 .HasColumnType(
"integer");
141 b.Property<
string>(
"Output")
143 .HasColumnType(
"text");
145 b.Property<
long>(
"RevisionInformationId")
146 .HasColumnType(
"bigint");
150 b.HasIndex(
"DirectoryName");
155 b.HasIndex(
"RevisionInformationId");
157 b.ToTable(
"CompileJobs");
160 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
162 b.Property<
long>(
"Id")
163 .ValueGeneratedOnAdd()
164 .HasColumnType(
"bigint")
165 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
167 b.Property<
bool?>(
"AllowWebClient")
169 .HasColumnType(
"boolean");
171 b.Property<
bool?>(
"AutoStart")
173 .HasColumnType(
"boolean");
175 b.Property<
long>(
"HeartbeatSeconds")
176 .HasColumnType(
"bigint");
178 b.Property<
long>(
"InstanceId")
179 .HasColumnType(
"bigint");
181 b.Property<
int>(
"Port")
182 .HasColumnType(
"integer");
184 b.Property<
int>(
"SecurityLevel")
185 .HasColumnType(
"integer");
187 b.Property<
long>(
"StartupTimeout")
188 .HasColumnType(
"bigint");
190 b.Property<
long>(
"TopicRequestTimeout")
191 .HasColumnType(
"bigint");
195 b.HasIndex(
"InstanceId")
198 b.ToTable(
"DreamDaemonSettings");
201 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
203 b.Property<
long>(
"Id")
204 .ValueGeneratedOnAdd()
205 .HasColumnType(
"bigint")
206 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
208 b.Property<
int>(
"ApiValidationPort")
209 .HasColumnType(
"integer");
211 b.Property<
int>(
"ApiValidationSecurityLevel")
212 .HasColumnType(
"integer");
214 b.Property<
long>(
"InstanceId")
215 .HasColumnType(
"bigint");
217 b.Property<
string>(
"ProjectName")
218 .HasColumnType(
"character varying(10000)")
219 .HasMaxLength(10000);
221 b.Property<
bool?>(
"RequireDMApiValidation")
223 .HasColumnType(
"boolean");
227 b.HasIndex(
"InstanceId")
230 b.ToTable(
"DreamMakerSettings");
233 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Instance", b =>
235 b.Property<
long>(
"Id")
236 .ValueGeneratedOnAdd()
237 .HasColumnType(
"bigint")
238 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
240 b.Property<
long>(
"AutoUpdateInterval")
241 .HasColumnType(
"bigint");
243 b.Property<
int>(
"ChatBotLimit")
244 .HasColumnType(
"integer");
246 b.Property<
int>(
"ConfigurationType")
247 .HasColumnType(
"integer");
249 b.Property<
string>(
"Name")
251 .HasColumnType(
"character varying(10000)")
252 .HasMaxLength(10000);
254 b.Property<
bool?>(
"Online")
256 .HasColumnType(
"boolean");
258 b.Property<
string>(
"Path")
260 .HasColumnType(
"text");
267 b.ToTable(
"Instances");
270 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
272 b.Property<
long>(
"Id")
273 .ValueGeneratedOnAdd()
274 .HasColumnType(
"bigint")
275 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
277 b.Property<decimal>(
"ByondRights")
278 .HasColumnType(
"numeric(20,0)");
280 b.Property<decimal>(
"ChatBotRights")
281 .HasColumnType(
"numeric(20,0)");
283 b.Property<decimal>(
"ConfigurationRights")
284 .HasColumnType(
"numeric(20,0)");
286 b.Property<decimal>(
"DreamDaemonRights")
287 .HasColumnType(
"numeric(20,0)");
289 b.Property<decimal>(
"DreamMakerRights")
290 .HasColumnType(
"numeric(20,0)");
292 b.Property<
long>(
"InstanceId")
293 .HasColumnType(
"bigint");
295 b.Property<decimal>(
"InstanceUserRights")
296 .HasColumnType(
"numeric(20,0)");
298 b.Property<decimal>(
"RepositoryRights")
299 .HasColumnType(
"numeric(20,0)");
301 b.Property<
long?>(
"UserId")
303 .HasColumnType(
"bigint");
307 b.HasIndex(
"InstanceId");
309 b.HasIndex(
"UserId",
"InstanceId")
312 b.ToTable(
"InstanceUsers");
315 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
317 b.Property<
long>(
"Id")
318 .ValueGeneratedOnAdd()
319 .HasColumnType(
"bigint")
320 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
322 b.Property<decimal?>(
"CancelRight")
323 .HasColumnType(
"numeric(20,0)");
325 b.Property<decimal?>(
"CancelRightsType")
326 .HasColumnType(
"numeric(20,0)");
328 b.Property<
bool?>(
"Cancelled")
330 .HasColumnType(
"boolean");
332 b.Property<
long?>(
"CancelledById")
333 .HasColumnType(
"bigint");
335 b.Property<
string>(
"Description")
337 .HasColumnType(
"text");
339 b.Property<
long?>(
"ErrorCode")
340 .HasColumnType(
"bigint");
342 b.Property<
string>(
"ExceptionDetails")
343 .HasColumnType(
"text");
345 b.Property<
long>(
"InstanceId")
346 .HasColumnType(
"bigint");
348 b.Property<DateTimeOffset?>(
"StartedAt")
350 .HasColumnType(
"timestamp with time zone");
352 b.Property<
long>(
"StartedById")
353 .HasColumnType(
"bigint");
355 b.Property<DateTimeOffset?>(
"StoppedAt")
356 .HasColumnType(
"timestamp with time zone");
360 b.HasIndex(
"CancelledById");
362 b.HasIndex(
"InstanceId");
364 b.HasIndex(
"StartedById");
369 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
371 b.Property<
long>(
"Id")
372 .ValueGeneratedOnAdd()
373 .HasColumnType(
"bigint")
374 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
376 b.Property<
string>(
"AccessIdentifier")
378 .HasColumnType(
"text");
380 b.Property<
long>(
"CompileJobId")
381 .HasColumnType(
"bigint");
383 b.Property<
int>(
"LaunchSecurityLevel")
384 .HasColumnType(
"integer");
386 b.Property<
int>(
"Port")
387 .HasColumnType(
"integer");
389 b.Property<
int>(
"ProcessId")
390 .HasColumnType(
"integer");
392 b.Property<
int>(
"RebootState")
393 .HasColumnType(
"integer");
397 b.HasIndex(
"CompileJobId");
399 b.ToTable(
"ReattachInformations");
402 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
404 b.Property<
long>(
"Id")
405 .ValueGeneratedOnAdd()
406 .HasColumnType(
"bigint")
407 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
409 b.Property<
string>(
"AccessToken")
410 .HasColumnType(
"character varying(10000)")
411 .HasMaxLength(10000);
413 b.Property<
string>(
"AccessUser")
414 .HasColumnType(
"character varying(10000)")
415 .HasMaxLength(10000);
417 b.Property<
bool?>(
"AutoUpdatesKeepTestMerges")
419 .HasColumnType(
"boolean");
421 b.Property<
bool?>(
"AutoUpdatesSynchronize")
423 .HasColumnType(
"boolean");
425 b.Property<
string>(
"CommitterEmail")
427 .HasColumnType(
"character varying(10000)")
428 .HasMaxLength(10000);
430 b.Property<
string>(
"CommitterName")
432 .HasColumnType(
"character varying(10000)")
433 .HasMaxLength(10000);
435 b.Property<
long>(
"InstanceId")
436 .HasColumnType(
"bigint");
438 b.Property<
bool?>(
"PostTestMergeComment")
440 .HasColumnType(
"boolean");
442 b.Property<
bool?>(
"PushTestMergeCommits")
444 .HasColumnType(
"boolean");
446 b.Property<
bool?>(
"ShowTestMergeCommitters")
448 .HasColumnType(
"boolean");
452 b.HasIndex(
"InstanceId")
455 b.ToTable(
"RepositorySettings");
458 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
460 b.Property<
long>(
"Id")
461 .ValueGeneratedOnAdd()
462 .HasColumnType(
"bigint")
463 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
465 b.Property<
long>(
"RevisionInformationId")
466 .HasColumnType(
"bigint");
468 b.Property<
long>(
"TestMergeId")
469 .HasColumnType(
"bigint");
473 b.HasIndex(
"RevisionInformationId");
475 b.HasIndex(
"TestMergeId");
477 b.ToTable(
"RevInfoTestMerges");
480 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
482 b.Property<
long>(
"Id")
483 .ValueGeneratedOnAdd()
484 .HasColumnType(
"bigint")
485 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
487 b.Property<
string>(
"CommitSha")
489 .HasColumnType(
"character varying(40)")
492 b.Property<
long>(
"InstanceId")
493 .HasColumnType(
"bigint");
495 b.Property<
string>(
"OriginCommitSha")
497 .HasColumnType(
"character varying(40)")
502 b.HasIndex(
"InstanceId",
"CommitSha")
505 b.ToTable(
"RevisionInformations");
508 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
510 b.Property<
long>(
"Id")
511 .ValueGeneratedOnAdd()
512 .HasColumnType(
"bigint")
513 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
515 b.Property<
string>(
"Author")
517 .HasColumnType(
"text");
519 b.Property<
string>(
"BodyAtMerge")
521 .HasColumnType(
"text");
523 b.Property<
string>(
"Comment")
524 .HasColumnType(
"character varying(10000)")
525 .HasMaxLength(10000);
527 b.Property<DateTimeOffset>(
"MergedAt")
528 .HasColumnType(
"timestamp with time zone");
530 b.Property<
long>(
"MergedById")
531 .HasColumnType(
"bigint");
533 b.Property<
int>(
"Number")
534 .HasColumnType(
"integer");
536 b.Property<
long?>(
"PrimaryRevisionInformationId")
538 .HasColumnType(
"bigint");
540 b.Property<
string>(
"PullRequestRevision")
542 .HasColumnType(
"character varying(40)")
545 b.Property<
string>(
"TitleAtMerge")
547 .HasColumnType(
"text");
549 b.Property<
string>(
"Url")
551 .HasColumnType(
"text");
555 b.HasIndex(
"MergedById");
557 b.HasIndex(
"PrimaryRevisionInformationId")
560 b.ToTable(
"TestMerges");
563 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
565 b.Property<
long?>(
"Id")
566 .ValueGeneratedOnAdd()
567 .HasColumnType(
"bigint")
568 .HasAnnotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
570 b.Property<decimal>(
"AdministrationRights")
571 .HasColumnType(
"numeric(20,0)");
573 b.Property<
string>(
"CanonicalName")
575 .HasColumnType(
"text");
577 b.Property<DateTimeOffset?>(
"CreatedAt")
579 .HasColumnType(
"timestamp with time zone");
581 b.Property<
long?>(
"CreatedById")
582 .HasColumnType(
"bigint");
584 b.Property<
bool?>(
"Enabled")
586 .HasColumnType(
"boolean");
588 b.Property<decimal>(
"InstanceManagerRights")
589 .HasColumnType(
"numeric(20,0)");
591 b.Property<DateTimeOffset?>(
"LastPasswordUpdate")
592 .HasColumnType(
"timestamp with time zone");
594 b.Property<
string>(
"Name")
596 .HasColumnType(
"character varying(10000)")
597 .HasMaxLength(10000);
599 b.Property<
string>(
"PasswordHash")
600 .HasColumnType(
"text");
602 b.Property<
string>(
"SystemIdentifier")
603 .HasColumnType(
"text");
607 b.HasIndex(
"CanonicalName")
610 b.HasIndex(
"CreatedById");
612 b.HasIndex(
"SystemIdentifier")
618 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatBot", b =>
620 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
621 .WithMany(
"ChatSettings")
622 .HasForeignKey(
"InstanceId")
623 .OnDelete(DeleteBehavior.Cascade)
627 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ChatChannel", b =>
629 b.HasOne(
"Tgstation.Server.Host.Models.ChatBot",
"ChatSettings")
630 .WithMany(
"Channels")
631 .HasForeignKey(
"ChatSettingsId")
632 .OnDelete(DeleteBehavior.Cascade)
636 modelBuilder.Entity(
"Tgstation.Server.Host.Models.CompileJob", b =>
638 b.HasOne(
"Tgstation.Server.Host.Models.Job",
"Job")
640 .HasForeignKey(
"Tgstation.Server.Host.Models.CompileJob",
"JobId")
641 .OnDelete(DeleteBehavior.Cascade)
644 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
645 .WithMany(
"CompileJobs")
646 .HasForeignKey(
"RevisionInformationId")
647 .OnDelete(DeleteBehavior.Cascade)
651 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
653 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
654 .WithOne(
"DreamDaemonSettings")
655 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamDaemonSettings",
"InstanceId")
656 .OnDelete(DeleteBehavior.Cascade)
660 modelBuilder.Entity(
"Tgstation.Server.Host.Models.DreamMakerSettings", b =>
662 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
663 .WithOne(
"DreamMakerSettings")
664 .HasForeignKey(
"Tgstation.Server.Host.Models.DreamMakerSettings",
"InstanceId")
665 .OnDelete(DeleteBehavior.Cascade)
669 modelBuilder.Entity(
"Tgstation.Server.Host.Models.InstanceUser", b =>
671 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
672 .WithMany(
"InstanceUsers")
673 .HasForeignKey(
"InstanceId")
674 .OnDelete(DeleteBehavior.Cascade)
677 b.HasOne(
"Tgstation.Server.Host.Models.User",
null)
678 .WithMany(
"InstanceUsers")
679 .HasForeignKey(
"UserId")
680 .OnDelete(DeleteBehavior.Cascade)
684 modelBuilder.Entity(
"Tgstation.Server.Host.Models.Job", b =>
686 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CancelledBy")
688 .HasForeignKey(
"CancelledById");
690 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
692 .HasForeignKey(
"InstanceId")
693 .OnDelete(DeleteBehavior.Cascade)
696 b.HasOne(
"Tgstation.Server.Host.Models.User",
"StartedBy")
698 .HasForeignKey(
"StartedById")
699 .OnDelete(DeleteBehavior.Cascade)
703 modelBuilder.Entity(
"Tgstation.Server.Host.Models.ReattachInformation", b =>
705 b.HasOne(
"Tgstation.Server.Host.Models.CompileJob",
"CompileJob")
707 .HasForeignKey(
"CompileJobId")
708 .OnDelete(DeleteBehavior.Cascade)
712 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RepositorySettings", b =>
714 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
715 .WithOne(
"RepositorySettings")
716 .HasForeignKey(
"Tgstation.Server.Host.Models.RepositorySettings",
"InstanceId")
717 .OnDelete(DeleteBehavior.Cascade)
721 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
723 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"RevisionInformation")
724 .WithMany(
"ActiveTestMerges")
725 .HasForeignKey(
"RevisionInformationId")
726 .OnDelete(DeleteBehavior.Cascade)
729 b.HasOne(
"Tgstation.Server.Host.Models.TestMerge",
"TestMerge")
730 .WithMany(
"RevisonInformations")
731 .HasForeignKey(
"TestMergeId")
732 .OnDelete(DeleteBehavior.ClientNoAction)
736 modelBuilder.Entity(
"Tgstation.Server.Host.Models.RevisionInformation", b =>
738 b.HasOne(
"Tgstation.Server.Host.Models.Instance",
"Instance")
739 .WithMany(
"RevisionInformations")
740 .HasForeignKey(
"InstanceId")
741 .OnDelete(DeleteBehavior.Cascade)
745 modelBuilder.Entity(
"Tgstation.Server.Host.Models.TestMerge", b =>
747 b.HasOne(
"Tgstation.Server.Host.Models.User",
"MergedBy")
748 .WithMany(
"TestMerges")
749 .HasForeignKey(
"MergedById")
750 .OnDelete(DeleteBehavior.Restrict)
753 b.HasOne(
"Tgstation.Server.Host.Models.RevisionInformation",
"PrimaryRevisionInformation")
754 .WithOne(
"PrimaryTestMerge")
755 .HasForeignKey(
"Tgstation.Server.Host.Models.TestMerge",
"PrimaryRevisionInformationId")
756 .OnDelete(DeleteBehavior.Cascade)
760 modelBuilder.Entity(
"Tgstation.Server.Host.Models.User", b =>
762 b.HasOne(
"Tgstation.Server.Host.Models.User",
"CreatedBy")
763 .WithMany(
"CreatedUsers")
764 .HasForeignKey(
"CreatedById");
766#pragma warning restore 612, 618