tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs
Go to the documentation of this file.
1// <auto-generated />
2using System;
3using Microsoft.EntityFrameworkCore;
4using Microsoft.EntityFrameworkCore.Infrastructure;
5using Microsoft.EntityFrameworkCore.Migrations;
6
8{
9 [DbContext(typeof(MySqlDatabaseContext))]
10 [Migration("20180918204520_MYNullableAndForeignKeyCleanup")]
11 partial class MYNullableAndForeignKeyCleanup
12 {
14 protected override void BuildTargetModel(ModelBuilder modelBuilder)
15 {
16#pragma warning disable 612, 618
17 modelBuilder
18 .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
19 .HasAnnotation("Relational:MaxIdentifierLength", 64);
20
21 modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
22 {
23 b.Property<long>("Id")
24 .ValueGeneratedOnAdd();
25
26 b.Property<string>("ConnectionString")
27 .IsRequired();
28
29 b.Property<bool?>("Enabled");
30
31 b.Property<long>("InstanceId");
32
33 b.Property<string>("Name")
34 .IsRequired();
35
36 b.Property<int?>("Provider");
37
38 b.HasKey("Id");
39
40 b.HasIndex("InstanceId");
41
42 b.HasIndex("Name")
43 .IsUnique();
44
45 b.ToTable("ChatBots");
46 });
47
48 modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
49 {
50 b.Property<long>("Id")
51 .ValueGeneratedOnAdd();
52
53 b.Property<long>("ChatSettingsId");
54
55 b.Property<ulong?>("DiscordChannelId");
56
57 b.Property<string>("IrcChannel");
58
59 b.Property<bool?>("IsAdminChannel")
60 .IsRequired();
61
62 b.Property<bool?>("IsUpdatesChannel")
63 .IsRequired();
64
65 b.Property<bool?>("IsWatchdogChannel")
66 .IsRequired();
67
68 b.Property<string>("Tag");
69
70 b.HasKey("Id");
71
72 b.HasIndex("ChatSettingsId", "DiscordChannelId")
73 .IsUnique();
74
75 b.HasIndex("ChatSettingsId", "IrcChannel")
76 .IsUnique();
77
78 b.ToTable("ChatChannels");
79 });
80
81 modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
82 {
83 b.Property<long>("Id")
84 .ValueGeneratedOnAdd();
85
86 b.Property<string>("ByondVersion")
87 .IsRequired();
88
89 b.Property<Guid?>("DirectoryName")
90 .IsRequired();
91
92 b.Property<string>("DmeName")
93 .IsRequired();
94
95 b.Property<long>("JobId");
96
97 b.Property<int>("MinimumSecurityLevel");
98
99 b.Property<string>("Output")
100 .IsRequired();
101
102 b.Property<long>("RevisionInformationId");
103
104 b.HasKey("Id");
105
106 b.HasIndex("DirectoryName");
107
108 b.HasIndex("JobId")
109 .IsUnique();
110
111 b.HasIndex("RevisionInformationId");
112
113 b.ToTable("CompileJobs");
114 });
115
116 modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
117 {
118 b.Property<long>("Id")
119 .ValueGeneratedOnAdd();
120
121 b.Property<string>("AccessToken");
122
123 b.Property<bool?>("AllowWebClient")
124 .IsRequired();
125
126 b.Property<bool?>("AutoStart")
127 .IsRequired();
128
129 b.Property<long>("InstanceId");
130
131 b.Property<ushort?>("PrimaryPort")
132 .IsRequired();
133
134 b.Property<int?>("ProcessId");
135
136 b.Property<ushort?>("SecondaryPort")
137 .IsRequired();
138
139 b.Property<int>("SecurityLevel");
140
141 b.Property<bool?>("SoftRestart")
142 .IsRequired();
143
144 b.Property<bool?>("SoftShutdown")
145 .IsRequired();
146
147 b.Property<uint?>("StartupTimeout")
148 .IsRequired();
149
150 b.HasKey("Id");
151
152 b.HasIndex("InstanceId")
153 .IsUnique();
154
155 b.ToTable("DreamDaemonSettings");
156 });
157
158 modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
159 {
160 b.Property<long>("Id")
161 .ValueGeneratedOnAdd();
162
163 b.Property<ushort?>("ApiValidationPort")
164 .IsRequired();
165
166 b.Property<int>("ApiValidationSecurityLevel");
167
168 b.Property<long>("InstanceId");
169
170 b.Property<string>("ProjectName");
171
172 b.HasKey("Id");
173
174 b.HasIndex("InstanceId")
175 .IsUnique();
176
177 b.ToTable("DreamMakerSettings");
178 });
179
180 modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
181 {
182 b.Property<long>("Id")
183 .ValueGeneratedOnAdd();
184
185 b.Property<uint?>("AutoUpdateInterval")
186 .IsRequired();
187
188 b.Property<int>("ConfigurationType");
189
190 b.Property<string>("Name")
191 .IsRequired();
192
193 b.Property<bool?>("Online")
194 .IsRequired();
195
196 b.Property<string>("Path")
197 .IsRequired();
198
199 b.HasKey("Id");
200
201 b.HasIndex("Path")
202 .IsUnique();
203
204 b.ToTable("Instances");
205 });
206
207 modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
208 {
209 b.Property<long>("Id")
210 .ValueGeneratedOnAdd();
211
212 b.Property<ulong>("ByondRights");
213
214 b.Property<ulong>("ChatBotRights");
215
216 b.Property<ulong>("ConfigurationRights");
217
218 b.Property<ulong>("DreamDaemonRights");
219
220 b.Property<ulong>("DreamMakerRights");
221
222 b.Property<long>("InstanceId");
223
224 b.Property<ulong>("InstanceUserRights");
225
226 b.Property<ulong>("RepositoryRights");
227
228 b.Property<long?>("UserId")
229 .IsRequired();
230
231 b.HasKey("Id");
232
233 b.HasIndex("InstanceId");
234
235 b.HasIndex("UserId", "InstanceId")
236 .IsUnique();
237
238 b.ToTable("InstanceUsers");
239 });
240
241 modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
242 {
243 b.Property<long>("Id")
244 .ValueGeneratedOnAdd();
245
246 b.Property<ulong?>("CancelRight");
247
248 b.Property<ulong?>("CancelRightsType");
249
250 b.Property<bool?>("Cancelled")
251 .IsRequired();
252
253 b.Property<long?>("CancelledById");
254
255 b.Property<string>("Description")
256 .IsRequired();
257
258 b.Property<string>("ExceptionDetails");
259
260 b.Property<long>("InstanceId");
261
262 b.Property<DateTimeOffset?>("StartedAt")
263 .IsRequired();
264
265 b.Property<long>("StartedById");
266
267 b.Property<DateTimeOffset?>("StoppedAt");
268
269 b.HasKey("Id");
270
271 b.HasIndex("CancelledById");
272
273 b.HasIndex("InstanceId");
274
275 b.HasIndex("StartedById");
276
277 b.ToTable("Jobs");
278 });
279
280 modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
281 {
282 b.Property<long>("Id")
283 .ValueGeneratedOnAdd();
284
285 b.Property<string>("AccessIdentifier")
286 .IsRequired();
287
288 b.Property<string>("ChatChannelsJson")
289 .IsRequired();
290
291 b.Property<string>("ChatCommandsJson")
292 .IsRequired();
293
294 b.Property<long?>("CompileJobId");
295
296 b.Property<bool>("IsPrimary");
297
298 b.Property<ushort>("Port");
299
300 b.Property<int>("ProcessId");
301
302 b.Property<int>("RebootState");
303
304 b.Property<string>("ServerCommandsJson")
305 .IsRequired();
306
307 b.HasKey("Id");
308
309 b.HasIndex("CompileJobId");
310
311 b.ToTable("ReattachInformations");
312 });
313
314 modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
315 {
316 b.Property<long>("Id")
317 .ValueGeneratedOnAdd();
318
319 b.Property<string>("AccessToken");
320
321 b.Property<string>("AccessUser");
322
323 b.Property<bool?>("AutoUpdatesKeepTestMerges")
324 .IsRequired();
325
326 b.Property<bool?>("AutoUpdatesSynchronize")
327 .IsRequired();
328
329 b.Property<string>("CommitterEmail")
330 .IsRequired();
331
332 b.Property<string>("CommitterName")
333 .IsRequired();
334
335 b.Property<long>("InstanceId");
336
337 b.Property<bool?>("PushTestMergeCommits")
338 .IsRequired();
339
340 b.Property<bool?>("ShowTestMergeCommitters")
341 .IsRequired();
342
343 b.HasKey("Id");
344
345 b.HasIndex("InstanceId")
346 .IsUnique();
347
348 b.ToTable("RepositorySettings");
349 });
350
351 modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
352 {
353 b.Property<long>("Id")
354 .ValueGeneratedOnAdd();
355
356 b.Property<long>("RevisionInformationId");
357
358 b.Property<long>("TestMergeId");
359
360 b.HasKey("Id");
361
362 b.HasIndex("RevisionInformationId");
363
364 b.HasIndex("TestMergeId");
365
366 b.ToTable("RevInfoTestMerges");
367 });
368
369 modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
370 {
371 b.Property<long>("Id")
372 .ValueGeneratedOnAdd();
373
374 b.Property<string>("CommitSha")
375 .IsRequired()
376 .HasMaxLength(40);
377
378 b.Property<long>("InstanceId");
379
380 b.Property<string>("OriginCommitSha")
381 .IsRequired()
382 .HasMaxLength(40);
383
384 b.HasKey("Id");
385
386 b.HasIndex("CommitSha")
387 .IsUnique();
388
389 b.HasIndex("InstanceId");
390
391 b.ToTable("RevisionInformations");
392 });
393
394 modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
395 {
396 b.Property<long>("Id")
397 .ValueGeneratedOnAdd();
398
399 b.Property<string>("Author")
400 .IsRequired();
401
402 b.Property<string>("BodyAtMerge")
403 .IsRequired();
404
405 b.Property<string>("Comment");
406
407 b.Property<DateTimeOffset>("MergedAt");
408
409 b.Property<long>("MergedById");
410
411 b.Property<int?>("Number")
412 .IsRequired();
413
414 b.Property<long?>("PrimaryRevisionInformationId")
415 .IsRequired();
416
417 b.Property<string>("PullRequestRevision")
418 .IsRequired();
419
420 b.Property<string>("TitleAtMerge")
421 .IsRequired();
422
423 b.Property<string>("Url")
424 .IsRequired();
425
426 b.HasKey("Id");
427
428 b.HasIndex("MergedById");
429
430 b.HasIndex("PrimaryRevisionInformationId")
431 .IsUnique();
432
433 b.ToTable("TestMerges");
434 });
435
436 modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
437 {
438 b.Property<long>("Id")
439 .ValueGeneratedOnAdd();
440
441 b.Property<ulong>("AdministrationRights");
442
443 b.Property<string>("CanonicalName")
444 .IsRequired();
445
446 b.Property<DateTimeOffset?>("CreatedAt")
447 .IsRequired();
448
449 b.Property<long?>("CreatedById");
450
451 b.Property<bool?>("Enabled")
452 .IsRequired();
453
454 b.Property<ulong>("InstanceManagerRights");
455
456 b.Property<DateTimeOffset?>("LastPasswordUpdate");
457
458 b.Property<string>("Name")
459 .IsRequired();
460
461 b.Property<string>("PasswordHash");
462
463 b.Property<string>("SystemIdentifier");
464
465 b.HasKey("Id");
466
467 b.HasIndex("CanonicalName")
468 .IsUnique();
469
470 b.HasIndex("CreatedById");
471
472 b.ToTable("Users");
473 });
474
475 modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
476 {
477 b.Property<long>("Id")
478 .ValueGeneratedOnAdd();
479
480 b.Property<long?>("AlphaId");
481
482 b.Property<bool>("AlphaIsActive");
483
484 b.Property<long?>("BravoId");
485
486 b.Property<long>("InstanceId");
487
488 b.HasKey("Id");
489
490 b.HasIndex("AlphaId");
491
492 b.HasIndex("BravoId");
493
494 b.HasIndex("InstanceId")
495 .IsUnique();
496
497 b.ToTable("WatchdogReattachInformations");
498 });
499
500 modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
501 {
502 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
503 .WithMany("ChatSettings")
504 .HasForeignKey("InstanceId")
505 .OnDelete(DeleteBehavior.Cascade);
506 });
507
508 modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
509 {
510 b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
511 .WithMany("Channels")
512 .HasForeignKey("ChatSettingsId")
513 .OnDelete(DeleteBehavior.Cascade);
514 });
515
516 modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
517 {
518 b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
519 .WithOne()
520 .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
521 .OnDelete(DeleteBehavior.Restrict);
522
523 b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
524 .WithMany("CompileJobs")
525 .HasForeignKey("RevisionInformationId")
526 .OnDelete(DeleteBehavior.Cascade);
527 });
528
529 modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
530 {
531 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
532 .WithOne("DreamDaemonSettings")
533 .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
534 .OnDelete(DeleteBehavior.Cascade);
535 });
536
537 modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
538 {
539 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
540 .WithOne("DreamMakerSettings")
541 .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
542 .OnDelete(DeleteBehavior.Cascade);
543 });
544
545 modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
546 {
547 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
548 .WithMany("InstanceUsers")
549 .HasForeignKey("InstanceId")
550 .OnDelete(DeleteBehavior.Cascade);
551
552 b.HasOne("Tgstation.Server.Host.Models.User")
553 .WithMany("InstanceUsers")
554 .HasForeignKey("UserId")
555 .OnDelete(DeleteBehavior.Cascade);
556 });
557
558 modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
559 {
560 b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
561 .WithMany()
562 .HasForeignKey("CancelledById");
563
564 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
565 .WithMany("Jobs")
566 .HasForeignKey("InstanceId")
567 .OnDelete(DeleteBehavior.Cascade);
568
569 b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
570 .WithMany()
571 .HasForeignKey("StartedById")
572 .OnDelete(DeleteBehavior.Cascade);
573 });
574
575 modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
576 {
577 b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
578 .WithMany()
579 .HasForeignKey("CompileJobId");
580 });
581
582 modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
583 {
584 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
585 .WithOne("RepositorySettings")
586 .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
587 .OnDelete(DeleteBehavior.Cascade);
588 });
589
590 modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
591 {
592 b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
593 .WithMany("ActiveTestMerges")
594 .HasForeignKey("RevisionInformationId")
595 .OnDelete(DeleteBehavior.Cascade);
596
597 b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
598 .WithMany("RevisonInformations")
599 .HasForeignKey("TestMergeId")
600 .OnDelete(DeleteBehavior.Cascade);
601 });
602
603 modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
604 {
605 b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
606 .WithMany("RevisionInformations")
607 .HasForeignKey("InstanceId")
608 .OnDelete(DeleteBehavior.Cascade);
609 });
610
611 modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
612 {
613 b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
614 .WithMany("TestMerges")
615 .HasForeignKey("MergedById")
616 .OnDelete(DeleteBehavior.Restrict);
617
618 b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
619 .WithOne("PrimaryTestMerge")
620 .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
621 .OnDelete(DeleteBehavior.Restrict);
622 });
623
624 modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
625 {
626 b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
627 .WithMany("CreatedUsers")
628 .HasForeignKey("CreatedById");
629 });
630
631 modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
632 {
633 b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
634 .WithMany()
635 .HasForeignKey("AlphaId");
636
637 b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
638 .WithMany()
639 .HasForeignKey("BravoId");
640
641 b.HasOne("Tgstation.Server.Host.Models.Instance")
642 .WithOne("WatchdogReattachInformation")
643 .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
644 .OnDelete(DeleteBehavior.Cascade);
645 });
646#pragma warning restore 612, 618
647 }
648 }
649}