ScientificReport
20190604210715_Initial.cs
Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Migrations;
3 
4 namespace ScientificReport.Migrations
5 {
6  public partial class Initial : Migration
7  {
8  protected override void Up(MigrationBuilder migrationBuilder)
9  {
10  migrationBuilder.CreateTable(
11  name: "Articles",
12  columns: table => new
13  {
14  Id = table.Column<Guid>(nullable: false),
15  Title = table.Column<string>(nullable: true),
16  PublishingYear = table.Column<int>(nullable: false),
17  ArticleType = table.Column<int>(nullable: false),
18  LiabilityInfo = table.Column<string>(nullable: true),
19  DocumentInfo = table.Column<string>(nullable: true),
20  PublishingPlace = table.Column<string>(nullable: true),
21  PublishingHouseName = table.Column<string>(nullable: true),
22  IsPeriodical = table.Column<bool>(nullable: false),
23  Number = table.Column<int>(nullable: false),
24  PagesAmount = table.Column<int>(nullable: false),
25  IsPrintCanceled = table.Column<bool>(nullable: false),
26  IsRecommendedToPrint = table.Column<bool>(nullable: false)
27  },
28  constraints: table =>
29  {
30  table.PrimaryKey("PK_Articles", x => x.Id);
31  });
32 
33  migrationBuilder.CreateTable(
34  name: "AspNetRoles",
35  columns: table => new
36  {
37  Id = table.Column<Guid>(nullable: false),
38  Name = table.Column<string>(maxLength: 256, nullable: true),
39  NormalizedName = table.Column<string>(maxLength: 256, nullable: true),
40  ConcurrencyStamp = table.Column<string>(nullable: true)
41  },
42  constraints: table =>
43  {
44  table.PrimaryKey("PK_AspNetRoles", x => x.Id);
45  });
46 
47  migrationBuilder.CreateTable(
48  name: "Grants",
49  columns: table => new
50  {
51  Id = table.Column<Guid>(nullable: false),
52  Info = table.Column<string>(nullable: true)
53  },
54  constraints: table =>
55  {
56  table.PrimaryKey("PK_Grants", x => x.Id);
57  });
58 
59  migrationBuilder.CreateTable(
60  name: "PatentLicenseActivities",
61  columns: table => new
62  {
63  Id = table.Column<Guid>(nullable: false),
64  Name = table.Column<string>(nullable: true),
65  Number = table.Column<int>(nullable: false),
66  Date = table.Column<DateTime>(nullable: false),
67  Type = table.Column<int>(nullable: false)
68  },
69  constraints: table =>
70  {
71  table.PrimaryKey("PK_PatentLicenseActivities", x => x.Id);
72  });
73 
74  migrationBuilder.CreateTable(
75  name: "Publications",
76  columns: table => new
77  {
78  Id = table.Column<Guid>(nullable: false),
79  Title = table.Column<string>(nullable: true),
80  PublishingYear = table.Column<int>(nullable: false),
81  PublicationType = table.Column<int>(nullable: false),
82  Specification = table.Column<string>(nullable: true),
83  PublishingPlace = table.Column<string>(nullable: true),
84  PublishingHouseName = table.Column<string>(nullable: true),
85  PagesAmount = table.Column<int>(nullable: false),
86  PrintStatus = table.Column<int>(nullable: false)
87  },
88  constraints: table =>
89  {
90  table.PrimaryKey("PK_Publications", x => x.Id);
91  });
92 
93  migrationBuilder.CreateTable(
94  name: "ScientificInternships",
95  columns: table => new
96  {
97  Id = table.Column<Guid>(nullable: false),
98  PlaceOfInternship = table.Column<string>(nullable: true),
99  Started = table.Column<DateTime>(nullable: false),
100  Ended = table.Column<DateTime>(nullable: false),
101  Contents = table.Column<string>(nullable: true)
102  },
103  constraints: table =>
104  {
105  table.PrimaryKey("PK_ScientificInternships", x => x.Id);
106  });
107 
108  migrationBuilder.CreateTable(
109  name: "AspNetRoleClaims",
110  columns: table => new
111  {
112  Id = table.Column<int>(nullable: false)
113  .Annotation("Sqlite:Autoincrement", true),
114  RoleId = table.Column<Guid>(nullable: false),
115  ClaimType = table.Column<string>(nullable: true),
116  ClaimValue = table.Column<string>(nullable: true)
117  },
118  constraints: table =>
119  {
120  table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
121  table.ForeignKey(
122  name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
123  column: x => x.RoleId,
124  principalTable: "AspNetRoles",
125  principalColumn: "Id",
126  onDelete: ReferentialAction.Cascade);
127  });
128 
129  migrationBuilder.CreateTable(
130  name: "CoApplicantsPatentLicenseActivities",
131  columns: table => new
132  {
133  Id = table.Column<Guid>(nullable: false),
134  CoApplicant = table.Column<string>(nullable: true),
135  PatentLicenseActivityId = table.Column<Guid>(nullable: false)
136  },
137  constraints: table =>
138  {
139  table.PrimaryKey("PK_CoApplicantsPatentLicenseActivities", x => x.Id);
140  table.ForeignKey(
141  name: "FK_CoApplicantsPatentLicenseActivities_PatentLicenseActivities_PatentLicenseActivityId",
142  column: x => x.PatentLicenseActivityId,
143  principalTable: "PatentLicenseActivities",
144  principalColumn: "Id",
145  onDelete: ReferentialAction.Cascade);
146  });
147 
148  migrationBuilder.CreateTable(
149  name: "CoauthorsPatentLicenseActivities",
150  columns: table => new
151  {
152  Id = table.Column<Guid>(nullable: false),
153  Coauthor = table.Column<string>(nullable: true),
154  PatentLicenseActivityId = table.Column<Guid>(nullable: false)
155  },
156  constraints: table =>
157  {
158  table.PrimaryKey("PK_CoauthorsPatentLicenseActivities", x => x.Id);
159  table.ForeignKey(
160  name: "FK_CoauthorsPatentLicenseActivities_PatentLicenseActivities_PatentLicenseActivityId",
161  column: x => x.PatentLicenseActivityId,
162  principalTable: "PatentLicenseActivities",
163  principalColumn: "Id",
164  onDelete: ReferentialAction.Cascade);
165  });
166 
167  migrationBuilder.CreateTable(
168  name: "TeacherReportsArticles",
169  columns: table => new
170  {
171  Id = table.Column<Guid>(nullable: false),
172  TeacherReportId = table.Column<Guid>(nullable: true),
173  ArticleId = table.Column<Guid>(nullable: true)
174  },
175  constraints: table =>
176  {
177  table.PrimaryKey("PK_TeacherReportsArticles", x => x.Id);
178  table.ForeignKey(
179  name: "FK_TeacherReportsArticles_Articles_ArticleId",
180  column: x => x.ArticleId,
181  principalTable: "Articles",
182  principalColumn: "Id",
183  onDelete: ReferentialAction.Restrict);
184  });
185 
186  migrationBuilder.CreateTable(
187  name: "UserProfilesArticles",
188  columns: table => new
189  {
190  Id = table.Column<Guid>(nullable: false),
191  AuthorId = table.Column<Guid>(nullable: false),
192  ArticleId = table.Column<Guid>(nullable: false)
193  },
194  constraints: table =>
195  {
196  table.PrimaryKey("PK_UserProfilesArticles", x => x.Id);
197  table.ForeignKey(
198  name: "FK_UserProfilesArticles_Articles_ArticleId",
199  column: x => x.ArticleId,
200  principalTable: "Articles",
201  principalColumn: "Id",
202  onDelete: ReferentialAction.Cascade);
203  });
204 
205  migrationBuilder.CreateTable(
206  name: "AspNetUserRoles",
207  columns: table => new
208  {
209  UserId = table.Column<Guid>(nullable: false),
210  RoleId = table.Column<Guid>(nullable: false)
211  },
212  constraints: table =>
213  {
214  table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
215  table.ForeignKey(
216  name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
217  column: x => x.RoleId,
218  principalTable: "AspNetRoles",
219  principalColumn: "Id",
220  onDelete: ReferentialAction.Cascade);
221  });
222 
223  migrationBuilder.CreateTable(
224  name: "ApplicantsPatentLicenseActivities",
225  columns: table => new
226  {
227  Id = table.Column<Guid>(nullable: false),
228  ApplicantId = table.Column<Guid>(nullable: false),
229  PatentLicenseActivityId = table.Column<Guid>(nullable: false)
230  },
231  constraints: table =>
232  {
233  table.PrimaryKey("PK_ApplicantsPatentLicenseActivities", x => x.Id);
234  table.ForeignKey(
235  name: "FK_ApplicantsPatentLicenseActivities_PatentLicenseActivities_PatentLicenseActivityId",
236  column: x => x.PatentLicenseActivityId,
237  principalTable: "PatentLicenseActivities",
238  principalColumn: "Id",
239  onDelete: ReferentialAction.Cascade);
240  });
241 
242  migrationBuilder.CreateTable(
243  name: "AspNetUserClaims",
244  columns: table => new
245  {
246  Id = table.Column<int>(nullable: false)
247  .Annotation("Sqlite:Autoincrement", true),
248  UserId = table.Column<Guid>(nullable: false),
249  ClaimType = table.Column<string>(nullable: true),
250  ClaimValue = table.Column<string>(nullable: true)
251  },
252  constraints: table =>
253  {
254  table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
255  });
256 
257  migrationBuilder.CreateTable(
258  name: "AspNetUserLogins",
259  columns: table => new
260  {
261  LoginProvider = table.Column<string>(nullable: false),
262  ProviderKey = table.Column<string>(nullable: false),
263  ProviderDisplayName = table.Column<string>(nullable: true),
264  UserId = table.Column<Guid>(nullable: false)
265  },
266  constraints: table =>
267  {
268  table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
269  });
270 
271  migrationBuilder.CreateTable(
272  name: "AspNetUserTokens",
273  columns: table => new
274  {
275  UserId = table.Column<Guid>(nullable: false),
276  LoginProvider = table.Column<string>(nullable: false),
277  Name = table.Column<string>(nullable: false),
278  Value = table.Column<string>(nullable: true)
279  },
280  constraints: table =>
281  {
282  table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
283  });
284 
285  migrationBuilder.CreateTable(
286  name: "AuthorsPatentLicenseActivities",
287  columns: table => new
288  {
289  Id = table.Column<Guid>(nullable: false),
290  AuthorId = table.Column<Guid>(nullable: false),
291  PatentLicenseActivityId = table.Column<Guid>(nullable: false)
292  },
293  constraints: table =>
294  {
295  table.PrimaryKey("PK_AuthorsPatentLicenseActivities", x => x.Id);
296  table.ForeignKey(
297  name: "FK_AuthorsPatentLicenseActivities_PatentLicenseActivities_PatentLicenseActivityId",
298  column: x => x.PatentLicenseActivityId,
299  principalTable: "PatentLicenseActivities",
300  principalColumn: "Id",
301  onDelete: ReferentialAction.Cascade);
302  });
303 
304  migrationBuilder.CreateTable(
305  name: "DepartmentReports",
306  columns: table => new
307  {
308  Id = table.Column<Guid>(nullable: false),
309  Created = table.Column<DateTime>(nullable: false),
310  Edited = table.Column<DateTime>(nullable: false),
311  HeadOfDepartmentId = table.Column<Guid>(nullable: true),
312  FacultyReportId = table.Column<Guid>(nullable: true)
313  },
314  constraints: table =>
315  {
316  table.PrimaryKey("PK_DepartmentReports", x => x.Id);
317  });
318 
319  migrationBuilder.CreateTable(
320  name: "Conferences",
321  columns: table => new
322  {
323  Id = table.Column<Guid>(nullable: false),
324  Topic = table.Column<string>(nullable: true),
325  Type = table.Column<int>(nullable: false),
326  Date = table.Column<DateTime>(nullable: false),
327  DepartmentReportId = table.Column<Guid>(nullable: true)
328  },
329  constraints: table =>
330  {
331  table.PrimaryKey("PK_Conferences", x => x.Id);
332  table.ForeignKey(
333  name: "FK_Conferences_DepartmentReports_DepartmentReportId",
334  column: x => x.DepartmentReportId,
335  principalTable: "DepartmentReports",
336  principalColumn: "Id",
337  onDelete: ReferentialAction.Restrict);
338  });
339 
340  migrationBuilder.CreateTable(
341  name: "ReportTheses",
342  columns: table => new
343  {
344  Id = table.Column<Guid>(nullable: false),
345  Thesis = table.Column<string>(nullable: true),
346  ConferenceId = table.Column<Guid>(nullable: true)
347  },
348  constraints: table =>
349  {
350  table.PrimaryKey("PK_ReportTheses", x => x.Id);
351  table.ForeignKey(
352  name: "FK_ReportTheses_Conferences_ConferenceId",
353  column: x => x.ConferenceId,
354  principalTable: "Conferences",
355  principalColumn: "Id",
356  onDelete: ReferentialAction.Restrict);
357  });
358 
359  migrationBuilder.CreateTable(
360  name: "Departments",
361  columns: table => new
362  {
363  Id = table.Column<Guid>(nullable: false),
364  Title = table.Column<string>(nullable: true),
365  HeadId = table.Column<Guid>(nullable: true)
366  },
367  constraints: table =>
368  {
369  table.PrimaryKey("PK_Departments", x => x.Id);
370  });
371 
372  migrationBuilder.CreateTable(
373  name: "AspNetUsers",
374  columns: table => new
375  {
376  Id = table.Column<Guid>(nullable: false),
377  UserName = table.Column<string>(maxLength: 256, nullable: true),
378  NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true),
379  Email = table.Column<string>(maxLength: 256, nullable: true),
380  NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
381  EmailConfirmed = table.Column<bool>(nullable: false),
382  PasswordHash = table.Column<string>(nullable: true),
383  SecurityStamp = table.Column<string>(nullable: true),
384  ConcurrencyStamp = table.Column<string>(nullable: true),
385  PhoneNumber = table.Column<string>(nullable: true),
386  PhoneNumberConfirmed = table.Column<bool>(nullable: false),
387  TwoFactorEnabled = table.Column<bool>(nullable: false),
388  LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
389  LockoutEnabled = table.Column<bool>(nullable: false),
390  AccessFailedCount = table.Column<int>(nullable: false),
391  FirstName = table.Column<string>(nullable: true),
392  MiddleName = table.Column<string>(nullable: true),
393  LastName = table.Column<string>(nullable: true),
394  BirthYear = table.Column<int>(nullable: false),
395  GraduationYear = table.Column<int>(nullable: false),
396  ScientificDegree = table.Column<string>(nullable: true),
397  YearDegreeGained = table.Column<int>(nullable: false),
398  AcademicStatus = table.Column<string>(nullable: true),
399  YearDegreeAssigned = table.Column<int>(nullable: false),
400  Position = table.Column<string>(nullable: true),
401  IsApproved = table.Column<bool>(nullable: false),
402  IsActive = table.Column<bool>(nullable: false),
403  Sex = table.Column<int>(nullable: false),
404  DepartmentId = table.Column<Guid>(nullable: true)
405  },
406  constraints: table =>
407  {
408  table.PrimaryKey("PK_AspNetUsers", x => x.Id);
409  table.ForeignKey(
410  name: "FK_AspNetUsers_Departments_DepartmentId",
411  column: x => x.DepartmentId,
412  principalTable: "Departments",
413  principalColumn: "Id",
414  onDelete: ReferentialAction.Restrict);
415  });
416 
417  migrationBuilder.CreateTable(
418  name: "ScientificWorks",
419  columns: table => new
420  {
421  Id = table.Column<Guid>(nullable: false),
422  Title = table.Column<string>(nullable: true),
423  PublishingYear = table.Column<int>(nullable: false),
424  Cypher = table.Column<string>(nullable: true),
425  Category = table.Column<string>(nullable: true),
426  Contents = table.Column<string>(nullable: true),
427  DepartmentId = table.Column<Guid>(nullable: true)
428  },
429  constraints: table =>
430  {
431  table.PrimaryKey("PK_ScientificWorks", x => x.Id);
432  table.ForeignKey(
433  name: "FK_ScientificWorks_Departments_DepartmentId",
434  column: x => x.DepartmentId,
435  principalTable: "Departments",
436  principalColumn: "Id",
437  onDelete: ReferentialAction.Restrict);
438  });
439 
440  migrationBuilder.CreateTable(
441  name: "FacultyReports",
442  columns: table => new
443  {
444  Id = table.Column<Guid>(nullable: false),
445  Created = table.Column<DateTime>(nullable: false),
446  Edited = table.Column<DateTime>(nullable: false),
447  AdministratorId = table.Column<Guid>(nullable: true)
448  },
449  constraints: table =>
450  {
451  table.PrimaryKey("PK_FacultyReports", x => x.Id);
452  table.ForeignKey(
453  name: "FK_FacultyReports_AspNetUsers_AdministratorId",
454  column: x => x.AdministratorId,
455  principalTable: "AspNetUsers",
456  principalColumn: "Id",
457  onDelete: ReferentialAction.Restrict);
458  });
459 
460  migrationBuilder.CreateTable(
461  name: "Memberships",
462  columns: table => new
463  {
464  Id = table.Column<Guid>(nullable: false),
465  Type = table.Column<int>(nullable: false),
466  MembershipInfo = table.Column<string>(nullable: true),
467  UserId = table.Column<Guid>(nullable: true)
468  },
469  constraints: table =>
470  {
471  table.PrimaryKey("PK_Memberships", x => x.Id);
472  table.ForeignKey(
473  name: "FK_Memberships_AspNetUsers_UserId",
474  column: x => x.UserId,
475  principalTable: "AspNetUsers",
476  principalColumn: "Id",
477  onDelete: ReferentialAction.Restrict);
478  });
479 
480  migrationBuilder.CreateTable(
481  name: "Oppositions",
482  columns: table => new
483  {
484  Id = table.Column<Guid>(nullable: false),
485  About = table.Column<string>(nullable: true),
486  DateOfOpposition = table.Column<DateTime>(nullable: false),
487  OpponentId = table.Column<Guid>(nullable: true)
488  },
489  constraints: table =>
490  {
491  table.PrimaryKey("PK_Oppositions", x => x.Id);
492  table.ForeignKey(
493  name: "FK_Oppositions_AspNetUsers_OpponentId",
494  column: x => x.OpponentId,
495  principalTable: "AspNetUsers",
496  principalColumn: "Id",
497  onDelete: ReferentialAction.Restrict);
498  });
499 
500  migrationBuilder.CreateTable(
501  name: "PostgraduateDissertationGuidances",
502  columns: table => new
503  {
504  Id = table.Column<Guid>(nullable: false),
505  GuideId = table.Column<Guid>(nullable: true),
506  PostgraduateName = table.Column<string>(nullable: true),
507  Dissertation = table.Column<string>(nullable: true),
508  Speciality = table.Column<string>(nullable: true),
509  DateDegreeGained = table.Column<DateTime>(nullable: false),
510  GraduationYear = table.Column<int>(nullable: false)
511  },
512  constraints: table =>
513  {
514  table.PrimaryKey("PK_PostgraduateDissertationGuidances", x => x.Id);
515  table.ForeignKey(
516  name: "FK_PostgraduateDissertationGuidances_AspNetUsers_GuideId",
517  column: x => x.GuideId,
518  principalTable: "AspNetUsers",
519  principalColumn: "Id",
520  onDelete: ReferentialAction.Restrict);
521  });
522 
523  migrationBuilder.CreateTable(
524  name: "PostgraduateGuidances",
525  columns: table => new
526  {
527  Id = table.Column<Guid>(nullable: false),
528  GuideId = table.Column<Guid>(nullable: true),
529  PostgraduateName = table.Column<string>(nullable: true),
530  PostgraduateInfo = table.Column<string>(nullable: true)
531  },
532  constraints: table =>
533  {
534  table.PrimaryKey("PK_PostgraduateGuidances", x => x.Id);
535  table.ForeignKey(
536  name: "FK_PostgraduateGuidances_AspNetUsers_GuideId",
537  column: x => x.GuideId,
538  principalTable: "AspNetUsers",
539  principalColumn: "Id",
540  onDelete: ReferentialAction.Restrict);
541  });
542 
543  migrationBuilder.CreateTable(
544  name: "Reviews",
545  columns: table => new
546  {
547  Id = table.Column<Guid>(nullable: false),
548  WorkId = table.Column<Guid>(nullable: true),
549  DateOfReview = table.Column<DateTime>(nullable: false),
550  ReviewerId = table.Column<Guid>(nullable: true)
551  },
552  constraints: table =>
553  {
554  table.PrimaryKey("PK_Reviews", x => x.Id);
555  table.ForeignKey(
556  name: "FK_Reviews_AspNetUsers_ReviewerId",
557  column: x => x.ReviewerId,
558  principalTable: "AspNetUsers",
559  principalColumn: "Id",
560  onDelete: ReferentialAction.Restrict);
561  table.ForeignKey(
562  name: "FK_Reviews_Publications_WorkId",
563  column: x => x.WorkId,
564  principalTable: "Publications",
565  principalColumn: "Id",
566  onDelete: ReferentialAction.Restrict);
567  });
568 
569  migrationBuilder.CreateTable(
570  name: "ScientificConsultations",
571  columns: table => new
572  {
573  Id = table.Column<Guid>(nullable: false),
574  GuideId = table.Column<Guid>(nullable: true),
575  CandidateName = table.Column<string>(nullable: true),
576  DissertationTitle = table.Column<string>(nullable: true)
577  },
578  constraints: table =>
579  {
580  table.PrimaryKey("PK_ScientificConsultations", x => x.Id);
581  table.ForeignKey(
582  name: "FK_ScientificConsultations_AspNetUsers_GuideId",
583  column: x => x.GuideId,
584  principalTable: "AspNetUsers",
585  principalColumn: "Id",
586  onDelete: ReferentialAction.Restrict);
587  });
588 
589  migrationBuilder.CreateTable(
590  name: "TeacherReports",
591  columns: table => new
592  {
593  Id = table.Column<Guid>(nullable: false),
594  Created = table.Column<DateTime>(nullable: false),
595  Edited = table.Column<DateTime>(nullable: false),
596  TeacherId = table.Column<Guid>(nullable: true),
597  DepartmentReportId = table.Column<Guid>(nullable: true)
598  },
599  constraints: table =>
600  {
601  table.PrimaryKey("PK_TeacherReports", x => x.Id);
602  table.ForeignKey(
603  name: "FK_TeacherReports_DepartmentReports_DepartmentReportId",
604  column: x => x.DepartmentReportId,
605  principalTable: "DepartmentReports",
606  principalColumn: "Id",
607  onDelete: ReferentialAction.Restrict);
608  table.ForeignKey(
609  name: "FK_TeacherReports_AspNetUsers_TeacherId",
610  column: x => x.TeacherId,
611  principalTable: "AspNetUsers",
612  principalColumn: "Id",
613  onDelete: ReferentialAction.Restrict);
614  });
615 
616  migrationBuilder.CreateTable(
617  name: "UserProfilesGrants",
618  columns: table => new
619  {
620  Id = table.Column<Guid>(nullable: false),
621  UserProfileId = table.Column<Guid>(nullable: false),
622  GrantId = table.Column<Guid>(nullable: false)
623  },
624  constraints: table =>
625  {
626  table.PrimaryKey("PK_UserProfilesGrants", x => x.Id);
627  table.ForeignKey(
628  name: "FK_UserProfilesGrants_Grants_GrantId",
629  column: x => x.GrantId,
630  principalTable: "Grants",
631  principalColumn: "Id",
632  onDelete: ReferentialAction.Cascade);
633  table.ForeignKey(
634  name: "FK_UserProfilesGrants_AspNetUsers_UserProfileId",
635  column: x => x.UserProfileId,
636  principalTable: "AspNetUsers",
637  principalColumn: "Id",
638  onDelete: ReferentialAction.Cascade);
639  });
640 
641  migrationBuilder.CreateTable(
642  name: "UserProfilesPublications",
643  columns: table => new
644  {
645  Id = table.Column<Guid>(nullable: false),
646  UserProfileId = table.Column<Guid>(nullable: false),
647  PublicationId = table.Column<Guid>(nullable: false)
648  },
649  constraints: table =>
650  {
651  table.PrimaryKey("PK_UserProfilesPublications", x => x.Id);
652  table.ForeignKey(
653  name: "FK_UserProfilesPublications_Publications_PublicationId",
654  column: x => x.PublicationId,
655  principalTable: "Publications",
656  principalColumn: "Id",
657  onDelete: ReferentialAction.Cascade);
658  table.ForeignKey(
659  name: "FK_UserProfilesPublications_AspNetUsers_UserProfileId",
660  column: x => x.UserProfileId,
661  principalTable: "AspNetUsers",
662  principalColumn: "Id",
663  onDelete: ReferentialAction.Cascade);
664  });
665 
666  migrationBuilder.CreateTable(
667  name: "UserProfilesReportTheses",
668  columns: table => new
669  {
670  Id = table.Column<Guid>(nullable: false),
671  UserProfileId = table.Column<Guid>(nullable: true),
672  ReportThesisId = table.Column<Guid>(nullable: true)
673  },
674  constraints: table =>
675  {
676  table.PrimaryKey("PK_UserProfilesReportTheses", x => x.Id);
677  table.ForeignKey(
678  name: "FK_UserProfilesReportTheses_ReportTheses_ReportThesisId",
679  column: x => x.ReportThesisId,
680  principalTable: "ReportTheses",
681  principalColumn: "Id",
682  onDelete: ReferentialAction.Restrict);
683  table.ForeignKey(
684  name: "FK_UserProfilesReportTheses_AspNetUsers_UserProfileId",
685  column: x => x.UserProfileId,
686  principalTable: "AspNetUsers",
687  principalColumn: "Id",
688  onDelete: ReferentialAction.Restrict);
689  });
690 
691  migrationBuilder.CreateTable(
692  name: "UserProfilesScientificInternships",
693  columns: table => new
694  {
695  Id = table.Column<Guid>(nullable: false),
696  UserProfileId = table.Column<Guid>(nullable: false),
697  ScientificInternshipId = table.Column<Guid>(nullable: false)
698  },
699  constraints: table =>
700  {
701  table.PrimaryKey("PK_UserProfilesScientificInternships", x => x.Id);
702  table.ForeignKey(
703  name: "FK_UserProfilesScientificInternships_ScientificInternships_ScientificInternshipId",
704  column: x => x.ScientificInternshipId,
705  principalTable: "ScientificInternships",
706  principalColumn: "Id",
707  onDelete: ReferentialAction.Cascade);
708  table.ForeignKey(
709  name: "FK_UserProfilesScientificInternships_AspNetUsers_UserProfileId",
710  column: x => x.UserProfileId,
711  principalTable: "AspNetUsers",
712  principalColumn: "Id",
713  onDelete: ReferentialAction.Cascade);
714  });
715 
716  migrationBuilder.CreateTable(
717  name: "UserProfilesScientificWorks",
718  columns: table => new
719  {
720  Id = table.Column<Guid>(nullable: false),
721  UserProfileId = table.Column<Guid>(nullable: true),
722  ScientificWorkId = table.Column<Guid>(nullable: true)
723  },
724  constraints: table =>
725  {
726  table.PrimaryKey("PK_UserProfilesScientificWorks", x => x.Id);
727  table.ForeignKey(
728  name: "FK_UserProfilesScientificWorks_ScientificWorks_ScientificWorkId",
729  column: x => x.ScientificWorkId,
730  principalTable: "ScientificWorks",
731  principalColumn: "Id",
732  onDelete: ReferentialAction.Restrict);
733  table.ForeignKey(
734  name: "FK_UserProfilesScientificWorks_AspNetUsers_UserProfileId",
735  column: x => x.UserProfileId,
736  principalTable: "AspNetUsers",
737  principalColumn: "Id",
738  onDelete: ReferentialAction.Restrict);
739  });
740 
741  migrationBuilder.CreateTable(
742  name: "TeacherReportsGrants",
743  columns: table => new
744  {
745  Id = table.Column<Guid>(nullable: false),
746  TeacherReportId = table.Column<Guid>(nullable: true),
747  GrantId = table.Column<Guid>(nullable: true)
748  },
749  constraints: table =>
750  {
751  table.PrimaryKey("PK_TeacherReportsGrants", x => x.Id);
752  table.ForeignKey(
753  name: "FK_TeacherReportsGrants_Grants_GrantId",
754  column: x => x.GrantId,
755  principalTable: "Grants",
756  principalColumn: "Id",
757  onDelete: ReferentialAction.Restrict);
758  table.ForeignKey(
759  name: "FK_TeacherReportsGrants_TeacherReports_TeacherReportId",
760  column: x => x.TeacherReportId,
761  principalTable: "TeacherReports",
762  principalColumn: "Id",
763  onDelete: ReferentialAction.Restrict);
764  });
765 
766  migrationBuilder.CreateTable(
767  name: "TeacherReportsMemberships",
768  columns: table => new
769  {
770  Id = table.Column<Guid>(nullable: false),
771  TeacherReportId = table.Column<Guid>(nullable: true),
772  MembershipId = table.Column<Guid>(nullable: true)
773  },
774  constraints: table =>
775  {
776  table.PrimaryKey("PK_TeacherReportsMemberships", x => x.Id);
777  table.ForeignKey(
778  name: "FK_TeacherReportsMemberships_Memberships_MembershipId",
779  column: x => x.MembershipId,
780  principalTable: "Memberships",
781  principalColumn: "Id",
782  onDelete: ReferentialAction.Restrict);
783  table.ForeignKey(
784  name: "FK_TeacherReportsMemberships_TeacherReports_TeacherReportId",
785  column: x => x.TeacherReportId,
786  principalTable: "TeacherReports",
787  principalColumn: "Id",
788  onDelete: ReferentialAction.Restrict);
789  });
790 
791  migrationBuilder.CreateTable(
792  name: "TeacherReportsOppositions",
793  columns: table => new
794  {
795  Id = table.Column<Guid>(nullable: false),
796  TeacherReportId = table.Column<Guid>(nullable: true),
797  OppositionId = table.Column<Guid>(nullable: true)
798  },
799  constraints: table =>
800  {
801  table.PrimaryKey("PK_TeacherReportsOppositions", x => x.Id);
802  table.ForeignKey(
803  name: "FK_TeacherReportsOppositions_Oppositions_OppositionId",
804  column: x => x.OppositionId,
805  principalTable: "Oppositions",
806  principalColumn: "Id",
807  onDelete: ReferentialAction.Restrict);
808  table.ForeignKey(
809  name: "FK_TeacherReportsOppositions_TeacherReports_TeacherReportId",
810  column: x => x.TeacherReportId,
811  principalTable: "TeacherReports",
812  principalColumn: "Id",
813  onDelete: ReferentialAction.Restrict);
814  });
815 
816  migrationBuilder.CreateTable(
817  name: "TeacherReportsPatents",
818  columns: table => new
819  {
820  Id = table.Column<Guid>(nullable: false),
821  TeacherReportId = table.Column<Guid>(nullable: true),
822  PatentId = table.Column<Guid>(nullable: true)
823  },
824  constraints: table =>
825  {
826  table.PrimaryKey("PK_TeacherReportsPatents", x => x.Id);
827  table.ForeignKey(
828  name: "FK_TeacherReportsPatents_PatentLicenseActivities_PatentId",
829  column: x => x.PatentId,
830  principalTable: "PatentLicenseActivities",
831  principalColumn: "Id",
832  onDelete: ReferentialAction.Restrict);
833  table.ForeignKey(
834  name: "FK_TeacherReportsPatents_TeacherReports_TeacherReportId",
835  column: x => x.TeacherReportId,
836  principalTable: "TeacherReports",
837  principalColumn: "Id",
838  onDelete: ReferentialAction.Restrict);
839  });
840 
841  migrationBuilder.CreateTable(
842  name: "TeacherReportsPostgraduateDissertationGuidances",
843  columns: table => new
844  {
845  Id = table.Column<Guid>(nullable: false),
846  TeacherReportId = table.Column<Guid>(nullable: true),
847  PostgraduateDissertationGuidanceId = table.Column<Guid>(nullable: true)
848  },
849  constraints: table =>
850  {
851  table.PrimaryKey("PK_TeacherReportsPostgraduateDissertationGuidances", x => x.Id);
852  table.ForeignKey(
853  name: "FK_TeacherReportsPostgraduateDissertationGuidances_PostgraduateDissertationGuidances_PostgraduateDissertationGuidanceId",
854  column: x => x.PostgraduateDissertationGuidanceId,
855  principalTable: "PostgraduateDissertationGuidances",
856  principalColumn: "Id",
857  onDelete: ReferentialAction.Restrict);
858  table.ForeignKey(
859  name: "FK_TeacherReportsPostgraduateDissertationGuidances_TeacherReports_TeacherReportId",
860  column: x => x.TeacherReportId,
861  principalTable: "TeacherReports",
862  principalColumn: "Id",
863  onDelete: ReferentialAction.Restrict);
864  });
865 
866  migrationBuilder.CreateTable(
867  name: "TeacherReportsPostgraduateGuidances",
868  columns: table => new
869  {
870  Id = table.Column<Guid>(nullable: false),
871  TeacherReportId = table.Column<Guid>(nullable: true),
872  PostgraduateGuidanceId = table.Column<Guid>(nullable: true)
873  },
874  constraints: table =>
875  {
876  table.PrimaryKey("PK_TeacherReportsPostgraduateGuidances", x => x.Id);
877  table.ForeignKey(
878  name: "FK_TeacherReportsPostgraduateGuidances_PostgraduateGuidances_PostgraduateGuidanceId",
879  column: x => x.PostgraduateGuidanceId,
880  principalTable: "PostgraduateGuidances",
881  principalColumn: "Id",
882  onDelete: ReferentialAction.Restrict);
883  table.ForeignKey(
884  name: "FK_TeacherReportsPostgraduateGuidances_TeacherReports_TeacherReportId",
885  column: x => x.TeacherReportId,
886  principalTable: "TeacherReports",
887  principalColumn: "Id",
888  onDelete: ReferentialAction.Restrict);
889  });
890 
891  migrationBuilder.CreateTable(
892  name: "TeacherReportsPublications",
893  columns: table => new
894  {
895  Id = table.Column<Guid>(nullable: false),
896  TeacherReportId = table.Column<Guid>(nullable: true),
897  PublicationId = table.Column<Guid>(nullable: true)
898  },
899  constraints: table =>
900  {
901  table.PrimaryKey("PK_TeacherReportsPublications", x => x.Id);
902  table.ForeignKey(
903  name: "FK_TeacherReportsPublications_Publications_PublicationId",
904  column: x => x.PublicationId,
905  principalTable: "Publications",
906  principalColumn: "Id",
907  onDelete: ReferentialAction.Restrict);
908  table.ForeignKey(
909  name: "FK_TeacherReportsPublications_TeacherReports_TeacherReportId",
910  column: x => x.TeacherReportId,
911  principalTable: "TeacherReports",
912  principalColumn: "Id",
913  onDelete: ReferentialAction.Restrict);
914  });
915 
916  migrationBuilder.CreateTable(
917  name: "TeacherReportsReportThesis",
918  columns: table => new
919  {
920  Id = table.Column<Guid>(nullable: false),
921  TeacherReportId = table.Column<Guid>(nullable: true),
922  ReportThesisId = table.Column<Guid>(nullable: true)
923  },
924  constraints: table =>
925  {
926  table.PrimaryKey("PK_TeacherReportsReportThesis", x => x.Id);
927  table.ForeignKey(
928  name: "FK_TeacherReportsReportThesis_ReportTheses_ReportThesisId",
929  column: x => x.ReportThesisId,
930  principalTable: "ReportTheses",
931  principalColumn: "Id",
932  onDelete: ReferentialAction.Restrict);
933  table.ForeignKey(
934  name: "FK_TeacherReportsReportThesis_TeacherReports_TeacherReportId",
935  column: x => x.TeacherReportId,
936  principalTable: "TeacherReports",
937  principalColumn: "Id",
938  onDelete: ReferentialAction.Restrict);
939  });
940 
941  migrationBuilder.CreateTable(
942  name: "TeacherReportsReviews",
943  columns: table => new
944  {
945  Id = table.Column<Guid>(nullable: false),
946  TeacherReportId = table.Column<Guid>(nullable: true),
947  ReviewId = table.Column<Guid>(nullable: true)
948  },
949  constraints: table =>
950  {
951  table.PrimaryKey("PK_TeacherReportsReviews", x => x.Id);
952  table.ForeignKey(
953  name: "FK_TeacherReportsReviews_Reviews_ReviewId",
954  column: x => x.ReviewId,
955  principalTable: "Reviews",
956  principalColumn: "Id",
957  onDelete: ReferentialAction.Restrict);
958  table.ForeignKey(
959  name: "FK_TeacherReportsReviews_TeacherReports_TeacherReportId",
960  column: x => x.TeacherReportId,
961  principalTable: "TeacherReports",
962  principalColumn: "Id",
963  onDelete: ReferentialAction.Restrict);
964  });
965 
966  migrationBuilder.CreateTable(
967  name: "TeacherReportsScientificConsultations",
968  columns: table => new
969  {
970  Id = table.Column<Guid>(nullable: false),
971  TeacherReportId = table.Column<Guid>(nullable: true),
972  ScientificConsultationId = table.Column<Guid>(nullable: true)
973  },
974  constraints: table =>
975  {
976  table.PrimaryKey("PK_TeacherReportsScientificConsultations", x => x.Id);
977  table.ForeignKey(
978  name: "FK_TeacherReportsScientificConsultations_ScientificConsultations_ScientificConsultationId",
979  column: x => x.ScientificConsultationId,
980  principalTable: "ScientificConsultations",
981  principalColumn: "Id",
982  onDelete: ReferentialAction.Restrict);
983  table.ForeignKey(
984  name: "FK_TeacherReportsScientificConsultations_TeacherReports_TeacherReportId",
985  column: x => x.TeacherReportId,
986  principalTable: "TeacherReports",
987  principalColumn: "Id",
988  onDelete: ReferentialAction.Restrict);
989  });
990 
991  migrationBuilder.CreateTable(
992  name: "TeacherReportsScientificInternships",
993  columns: table => new
994  {
995  Id = table.Column<Guid>(nullable: false),
996  TeacherReportId = table.Column<Guid>(nullable: true),
997  ScientificInternshipId = table.Column<Guid>(nullable: true)
998  },
999  constraints: table =>
1000  {
1001  table.PrimaryKey("PK_TeacherReportsScientificInternships", x => x.Id);
1002  table.ForeignKey(
1003  name: "FK_TeacherReportsScientificInternships_ScientificInternships_ScientificInternshipId",
1004  column: x => x.ScientificInternshipId,
1005  principalTable: "ScientificInternships",
1006  principalColumn: "Id",
1007  onDelete: ReferentialAction.Restrict);
1008  table.ForeignKey(
1009  name: "FK_TeacherReportsScientificInternships_TeacherReports_TeacherReportId",
1010  column: x => x.TeacherReportId,
1011  principalTable: "TeacherReports",
1012  principalColumn: "Id",
1013  onDelete: ReferentialAction.Restrict);
1014  });
1015 
1016  migrationBuilder.CreateTable(
1017  name: "TeacherReportsScientificWorks",
1018  columns: table => new
1019  {
1020  Id = table.Column<Guid>(nullable: false),
1021  TeacherReportId = table.Column<Guid>(nullable: true),
1022  ScientificWorkId = table.Column<Guid>(nullable: true)
1023  },
1024  constraints: table =>
1025  {
1026  table.PrimaryKey("PK_TeacherReportsScientificWorks", x => x.Id);
1027  table.ForeignKey(
1028  name: "FK_TeacherReportsScientificWorks_ScientificWorks_ScientificWorkId",
1029  column: x => x.ScientificWorkId,
1030  principalTable: "ScientificWorks",
1031  principalColumn: "Id",
1032  onDelete: ReferentialAction.Restrict);
1033  table.ForeignKey(
1034  name: "FK_TeacherReportsScientificWorks_TeacherReports_TeacherReportId",
1035  column: x => x.TeacherReportId,
1036  principalTable: "TeacherReports",
1037  principalColumn: "Id",
1038  onDelete: ReferentialAction.Restrict);
1039  });
1040 
1041  migrationBuilder.CreateIndex(
1042  name: "IX_ApplicantsPatentLicenseActivities_ApplicantId",
1043  table: "ApplicantsPatentLicenseActivities",
1044  column: "ApplicantId");
1045 
1046  migrationBuilder.CreateIndex(
1047  name: "IX_ApplicantsPatentLicenseActivities_PatentLicenseActivityId",
1048  table: "ApplicantsPatentLicenseActivities",
1049  column: "PatentLicenseActivityId");
1050 
1051  migrationBuilder.CreateIndex(
1052  name: "IX_AspNetRoleClaims_RoleId",
1053  table: "AspNetRoleClaims",
1054  column: "RoleId");
1055 
1056  migrationBuilder.CreateIndex(
1057  name: "RoleNameIndex",
1058  table: "AspNetRoles",
1059  column: "NormalizedName",
1060  unique: true);
1061 
1062  migrationBuilder.CreateIndex(
1063  name: "IX_AspNetUserClaims_UserId",
1064  table: "AspNetUserClaims",
1065  column: "UserId");
1066 
1067  migrationBuilder.CreateIndex(
1068  name: "IX_AspNetUserLogins_UserId",
1069  table: "AspNetUserLogins",
1070  column: "UserId");
1071 
1072  migrationBuilder.CreateIndex(
1073  name: "IX_AspNetUserRoles_RoleId",
1074  table: "AspNetUserRoles",
1075  column: "RoleId");
1076 
1077  migrationBuilder.CreateIndex(
1078  name: "IX_AspNetUsers_DepartmentId",
1079  table: "AspNetUsers",
1080  column: "DepartmentId");
1081 
1082  migrationBuilder.CreateIndex(
1083  name: "EmailIndex",
1084  table: "AspNetUsers",
1085  column: "NormalizedEmail");
1086 
1087  migrationBuilder.CreateIndex(
1088  name: "UserNameIndex",
1089  table: "AspNetUsers",
1090  column: "NormalizedUserName",
1091  unique: true);
1092 
1093  migrationBuilder.CreateIndex(
1094  name: "IX_AuthorsPatentLicenseActivities_AuthorId",
1095  table: "AuthorsPatentLicenseActivities",
1096  column: "AuthorId");
1097 
1098  migrationBuilder.CreateIndex(
1099  name: "IX_AuthorsPatentLicenseActivities_PatentLicenseActivityId",
1100  table: "AuthorsPatentLicenseActivities",
1101  column: "PatentLicenseActivityId");
1102 
1103  migrationBuilder.CreateIndex(
1104  name: "IX_CoApplicantsPatentLicenseActivities_PatentLicenseActivityId",
1105  table: "CoApplicantsPatentLicenseActivities",
1106  column: "PatentLicenseActivityId");
1107 
1108  migrationBuilder.CreateIndex(
1109  name: "IX_CoauthorsPatentLicenseActivities_PatentLicenseActivityId",
1110  table: "CoauthorsPatentLicenseActivities",
1111  column: "PatentLicenseActivityId");
1112 
1113  migrationBuilder.CreateIndex(
1114  name: "IX_Conferences_DepartmentReportId",
1115  table: "Conferences",
1116  column: "DepartmentReportId");
1117 
1118  migrationBuilder.CreateIndex(
1119  name: "IX_DepartmentReports_FacultyReportId",
1120  table: "DepartmentReports",
1121  column: "FacultyReportId");
1122 
1123  migrationBuilder.CreateIndex(
1124  name: "IX_DepartmentReports_HeadOfDepartmentId",
1125  table: "DepartmentReports",
1126  column: "HeadOfDepartmentId");
1127 
1128  migrationBuilder.CreateIndex(
1129  name: "IX_Departments_HeadId",
1130  table: "Departments",
1131  column: "HeadId");
1132 
1133  migrationBuilder.CreateIndex(
1134  name: "IX_FacultyReports_AdministratorId",
1135  table: "FacultyReports",
1136  column: "AdministratorId");
1137 
1138  migrationBuilder.CreateIndex(
1139  name: "IX_Memberships_UserId",
1140  table: "Memberships",
1141  column: "UserId");
1142 
1143  migrationBuilder.CreateIndex(
1144  name: "IX_Oppositions_OpponentId",
1145  table: "Oppositions",
1146  column: "OpponentId");
1147 
1148  migrationBuilder.CreateIndex(
1149  name: "IX_PostgraduateDissertationGuidances_GuideId",
1150  table: "PostgraduateDissertationGuidances",
1151  column: "GuideId");
1152 
1153  migrationBuilder.CreateIndex(
1154  name: "IX_PostgraduateGuidances_GuideId",
1155  table: "PostgraduateGuidances",
1156  column: "GuideId");
1157 
1158  migrationBuilder.CreateIndex(
1159  name: "IX_ReportTheses_ConferenceId",
1160  table: "ReportTheses",
1161  column: "ConferenceId");
1162 
1163  migrationBuilder.CreateIndex(
1164  name: "IX_Reviews_ReviewerId",
1165  table: "Reviews",
1166  column: "ReviewerId");
1167 
1168  migrationBuilder.CreateIndex(
1169  name: "IX_Reviews_WorkId",
1170  table: "Reviews",
1171  column: "WorkId");
1172 
1173  migrationBuilder.CreateIndex(
1174  name: "IX_ScientificConsultations_GuideId",
1175  table: "ScientificConsultations",
1176  column: "GuideId");
1177 
1178  migrationBuilder.CreateIndex(
1179  name: "IX_ScientificWorks_DepartmentId",
1180  table: "ScientificWorks",
1181  column: "DepartmentId");
1182 
1183  migrationBuilder.CreateIndex(
1184  name: "IX_TeacherReports_DepartmentReportId",
1185  table: "TeacherReports",
1186  column: "DepartmentReportId");
1187 
1188  migrationBuilder.CreateIndex(
1189  name: "IX_TeacherReports_TeacherId",
1190  table: "TeacherReports",
1191  column: "TeacherId");
1192 
1193  migrationBuilder.CreateIndex(
1194  name: "IX_TeacherReportsArticles_ArticleId",
1195  table: "TeacherReportsArticles",
1196  column: "ArticleId");
1197 
1198  migrationBuilder.CreateIndex(
1199  name: "IX_TeacherReportsArticles_TeacherReportId",
1200  table: "TeacherReportsArticles",
1201  column: "TeacherReportId");
1202 
1203  migrationBuilder.CreateIndex(
1204  name: "IX_TeacherReportsGrants_GrantId",
1205  table: "TeacherReportsGrants",
1206  column: "GrantId");
1207 
1208  migrationBuilder.CreateIndex(
1209  name: "IX_TeacherReportsGrants_TeacherReportId",
1210  table: "TeacherReportsGrants",
1211  column: "TeacherReportId");
1212 
1213  migrationBuilder.CreateIndex(
1214  name: "IX_TeacherReportsMemberships_MembershipId",
1215  table: "TeacherReportsMemberships",
1216  column: "MembershipId");
1217 
1218  migrationBuilder.CreateIndex(
1219  name: "IX_TeacherReportsMemberships_TeacherReportId",
1220  table: "TeacherReportsMemberships",
1221  column: "TeacherReportId");
1222 
1223  migrationBuilder.CreateIndex(
1224  name: "IX_TeacherReportsOppositions_OppositionId",
1225  table: "TeacherReportsOppositions",
1226  column: "OppositionId");
1227 
1228  migrationBuilder.CreateIndex(
1229  name: "IX_TeacherReportsOppositions_TeacherReportId",
1230  table: "TeacherReportsOppositions",
1231  column: "TeacherReportId");
1232 
1233  migrationBuilder.CreateIndex(
1234  name: "IX_TeacherReportsPatents_PatentId",
1235  table: "TeacherReportsPatents",
1236  column: "PatentId");
1237 
1238  migrationBuilder.CreateIndex(
1239  name: "IX_TeacherReportsPatents_TeacherReportId",
1240  table: "TeacherReportsPatents",
1241  column: "TeacherReportId");
1242 
1243  migrationBuilder.CreateIndex(
1244  name: "IX_TeacherReportsPostgraduateDissertationGuidances_PostgraduateDissertationGuidanceId",
1245  table: "TeacherReportsPostgraduateDissertationGuidances",
1246  column: "PostgraduateDissertationGuidanceId");
1247 
1248  migrationBuilder.CreateIndex(
1249  name: "IX_TeacherReportsPostgraduateDissertationGuidances_TeacherReportId",
1250  table: "TeacherReportsPostgraduateDissertationGuidances",
1251  column: "TeacherReportId");
1252 
1253  migrationBuilder.CreateIndex(
1254  name: "IX_TeacherReportsPostgraduateGuidances_PostgraduateGuidanceId",
1255  table: "TeacherReportsPostgraduateGuidances",
1256  column: "PostgraduateGuidanceId");
1257 
1258  migrationBuilder.CreateIndex(
1259  name: "IX_TeacherReportsPostgraduateGuidances_TeacherReportId",
1260  table: "TeacherReportsPostgraduateGuidances",
1261  column: "TeacherReportId");
1262 
1263  migrationBuilder.CreateIndex(
1264  name: "IX_TeacherReportsPublications_PublicationId",
1265  table: "TeacherReportsPublications",
1266  column: "PublicationId");
1267 
1268  migrationBuilder.CreateIndex(
1269  name: "IX_TeacherReportsPublications_TeacherReportId",
1270  table: "TeacherReportsPublications",
1271  column: "TeacherReportId");
1272 
1273  migrationBuilder.CreateIndex(
1274  name: "IX_TeacherReportsReportThesis_ReportThesisId",
1275  table: "TeacherReportsReportThesis",
1276  column: "ReportThesisId");
1277 
1278  migrationBuilder.CreateIndex(
1279  name: "IX_TeacherReportsReportThesis_TeacherReportId",
1280  table: "TeacherReportsReportThesis",
1281  column: "TeacherReportId");
1282 
1283  migrationBuilder.CreateIndex(
1284  name: "IX_TeacherReportsReviews_ReviewId",
1285  table: "TeacherReportsReviews",
1286  column: "ReviewId");
1287 
1288  migrationBuilder.CreateIndex(
1289  name: "IX_TeacherReportsReviews_TeacherReportId",
1290  table: "TeacherReportsReviews",
1291  column: "TeacherReportId");
1292 
1293  migrationBuilder.CreateIndex(
1294  name: "IX_TeacherReportsScientificConsultations_ScientificConsultationId",
1295  table: "TeacherReportsScientificConsultations",
1296  column: "ScientificConsultationId");
1297 
1298  migrationBuilder.CreateIndex(
1299  name: "IX_TeacherReportsScientificConsultations_TeacherReportId",
1300  table: "TeacherReportsScientificConsultations",
1301  column: "TeacherReportId");
1302 
1303  migrationBuilder.CreateIndex(
1304  name: "IX_TeacherReportsScientificInternships_ScientificInternshipId",
1305  table: "TeacherReportsScientificInternships",
1306  column: "ScientificInternshipId");
1307 
1308  migrationBuilder.CreateIndex(
1309  name: "IX_TeacherReportsScientificInternships_TeacherReportId",
1310  table: "TeacherReportsScientificInternships",
1311  column: "TeacherReportId");
1312 
1313  migrationBuilder.CreateIndex(
1314  name: "IX_TeacherReportsScientificWorks_ScientificWorkId",
1315  table: "TeacherReportsScientificWorks",
1316  column: "ScientificWorkId");
1317 
1318  migrationBuilder.CreateIndex(
1319  name: "IX_TeacherReportsScientificWorks_TeacherReportId",
1320  table: "TeacherReportsScientificWorks",
1321  column: "TeacherReportId");
1322 
1323  migrationBuilder.CreateIndex(
1324  name: "IX_UserProfilesArticles_ArticleId",
1325  table: "UserProfilesArticles",
1326  column: "ArticleId");
1327 
1328  migrationBuilder.CreateIndex(
1329  name: "IX_UserProfilesArticles_AuthorId",
1330  table: "UserProfilesArticles",
1331  column: "AuthorId");
1332 
1333  migrationBuilder.CreateIndex(
1334  name: "IX_UserProfilesGrants_GrantId",
1335  table: "UserProfilesGrants",
1336  column: "GrantId");
1337 
1338  migrationBuilder.CreateIndex(
1339  name: "IX_UserProfilesGrants_UserProfileId",
1340  table: "UserProfilesGrants",
1341  column: "UserProfileId");
1342 
1343  migrationBuilder.CreateIndex(
1344  name: "IX_UserProfilesPublications_PublicationId",
1345  table: "UserProfilesPublications",
1346  column: "PublicationId");
1347 
1348  migrationBuilder.CreateIndex(
1349  name: "IX_UserProfilesPublications_UserProfileId",
1350  table: "UserProfilesPublications",
1351  column: "UserProfileId");
1352 
1353  migrationBuilder.CreateIndex(
1354  name: "IX_UserProfilesReportTheses_ReportThesisId",
1355  table: "UserProfilesReportTheses",
1356  column: "ReportThesisId");
1357 
1358  migrationBuilder.CreateIndex(
1359  name: "IX_UserProfilesReportTheses_UserProfileId",
1360  table: "UserProfilesReportTheses",
1361  column: "UserProfileId");
1362 
1363  migrationBuilder.CreateIndex(
1364  name: "IX_UserProfilesScientificInternships_ScientificInternshipId",
1365  table: "UserProfilesScientificInternships",
1366  column: "ScientificInternshipId");
1367 
1368  migrationBuilder.CreateIndex(
1369  name: "IX_UserProfilesScientificInternships_UserProfileId",
1370  table: "UserProfilesScientificInternships",
1371  column: "UserProfileId");
1372 
1373  migrationBuilder.CreateIndex(
1374  name: "IX_UserProfilesScientificWorks_ScientificWorkId",
1375  table: "UserProfilesScientificWorks",
1376  column: "ScientificWorkId");
1377 
1378  migrationBuilder.CreateIndex(
1379  name: "IX_UserProfilesScientificWorks_UserProfileId",
1380  table: "UserProfilesScientificWorks",
1381  column: "UserProfileId");
1382 
1383  migrationBuilder.AddForeignKey(
1384  name: "FK_TeacherReportsArticles_TeacherReports_TeacherReportId",
1385  table: "TeacherReportsArticles",
1386  column: "TeacherReportId",
1387  principalTable: "TeacherReports",
1388  principalColumn: "Id",
1389  onDelete: ReferentialAction.Restrict);
1390 
1391  migrationBuilder.AddForeignKey(
1392  name: "FK_UserProfilesArticles_AspNetUsers_AuthorId",
1393  table: "UserProfilesArticles",
1394  column: "AuthorId",
1395  principalTable: "AspNetUsers",
1396  principalColumn: "Id",
1397  onDelete: ReferentialAction.Cascade);
1398 
1399  migrationBuilder.AddForeignKey(
1400  name: "FK_AspNetUserRoles_AspNetUsers_UserId",
1401  table: "AspNetUserRoles",
1402  column: "UserId",
1403  principalTable: "AspNetUsers",
1404  principalColumn: "Id",
1405  onDelete: ReferentialAction.Cascade);
1406 
1407  migrationBuilder.AddForeignKey(
1408  name: "FK_ApplicantsPatentLicenseActivities_AspNetUsers_ApplicantId",
1409  table: "ApplicantsPatentLicenseActivities",
1410  column: "ApplicantId",
1411  principalTable: "AspNetUsers",
1412  principalColumn: "Id",
1413  onDelete: ReferentialAction.Cascade);
1414 
1415  migrationBuilder.AddForeignKey(
1416  name: "FK_AspNetUserClaims_AspNetUsers_UserId",
1417  table: "AspNetUserClaims",
1418  column: "UserId",
1419  principalTable: "AspNetUsers",
1420  principalColumn: "Id",
1421  onDelete: ReferentialAction.Cascade);
1422 
1423  migrationBuilder.AddForeignKey(
1424  name: "FK_AspNetUserLogins_AspNetUsers_UserId",
1425  table: "AspNetUserLogins",
1426  column: "UserId",
1427  principalTable: "AspNetUsers",
1428  principalColumn: "Id",
1429  onDelete: ReferentialAction.Cascade);
1430 
1431  migrationBuilder.AddForeignKey(
1432  name: "FK_AspNetUserTokens_AspNetUsers_UserId",
1433  table: "AspNetUserTokens",
1434  column: "UserId",
1435  principalTable: "AspNetUsers",
1436  principalColumn: "Id",
1437  onDelete: ReferentialAction.Cascade);
1438 
1439  migrationBuilder.AddForeignKey(
1440  name: "FK_AuthorsPatentLicenseActivities_AspNetUsers_AuthorId",
1441  table: "AuthorsPatentLicenseActivities",
1442  column: "AuthorId",
1443  principalTable: "AspNetUsers",
1444  principalColumn: "Id",
1445  onDelete: ReferentialAction.Cascade);
1446 
1447  migrationBuilder.AddForeignKey(
1448  name: "FK_DepartmentReports_AspNetUsers_HeadOfDepartmentId",
1449  table: "DepartmentReports",
1450  column: "HeadOfDepartmentId",
1451  principalTable: "AspNetUsers",
1452  principalColumn: "Id",
1453  onDelete: ReferentialAction.Restrict);
1454 
1455  migrationBuilder.AddForeignKey(
1456  name: "FK_DepartmentReports_FacultyReports_FacultyReportId",
1457  table: "DepartmentReports",
1458  column: "FacultyReportId",
1459  principalTable: "FacultyReports",
1460  principalColumn: "Id",
1461  onDelete: ReferentialAction.Restrict);
1462 
1463  migrationBuilder.AddForeignKey(
1464  name: "FK_Departments_AspNetUsers_HeadId",
1465  table: "Departments",
1466  column: "HeadId",
1467  principalTable: "AspNetUsers",
1468  principalColumn: "Id",
1469  onDelete: ReferentialAction.Restrict);
1470  }
1471 
1472  protected override void Down(MigrationBuilder migrationBuilder)
1473  {
1474  migrationBuilder.DropForeignKey(
1475  name: "FK_Departments_AspNetUsers_HeadId",
1476  table: "Departments");
1477 
1478  migrationBuilder.DropTable(
1479  name: "ApplicantsPatentLicenseActivities");
1480 
1481  migrationBuilder.DropTable(
1482  name: "AspNetRoleClaims");
1483 
1484  migrationBuilder.DropTable(
1485  name: "AspNetUserClaims");
1486 
1487  migrationBuilder.DropTable(
1488  name: "AspNetUserLogins");
1489 
1490  migrationBuilder.DropTable(
1491  name: "AspNetUserRoles");
1492 
1493  migrationBuilder.DropTable(
1494  name: "AspNetUserTokens");
1495 
1496  migrationBuilder.DropTable(
1497  name: "AuthorsPatentLicenseActivities");
1498 
1499  migrationBuilder.DropTable(
1500  name: "CoApplicantsPatentLicenseActivities");
1501 
1502  migrationBuilder.DropTable(
1503  name: "CoauthorsPatentLicenseActivities");
1504 
1505  migrationBuilder.DropTable(
1506  name: "TeacherReportsArticles");
1507 
1508  migrationBuilder.DropTable(
1509  name: "TeacherReportsGrants");
1510 
1511  migrationBuilder.DropTable(
1512  name: "TeacherReportsMemberships");
1513 
1514  migrationBuilder.DropTable(
1515  name: "TeacherReportsOppositions");
1516 
1517  migrationBuilder.DropTable(
1518  name: "TeacherReportsPatents");
1519 
1520  migrationBuilder.DropTable(
1521  name: "TeacherReportsPostgraduateDissertationGuidances");
1522 
1523  migrationBuilder.DropTable(
1524  name: "TeacherReportsPostgraduateGuidances");
1525 
1526  migrationBuilder.DropTable(
1527  name: "TeacherReportsPublications");
1528 
1529  migrationBuilder.DropTable(
1530  name: "TeacherReportsReportThesis");
1531 
1532  migrationBuilder.DropTable(
1533  name: "TeacherReportsReviews");
1534 
1535  migrationBuilder.DropTable(
1536  name: "TeacherReportsScientificConsultations");
1537 
1538  migrationBuilder.DropTable(
1539  name: "TeacherReportsScientificInternships");
1540 
1541  migrationBuilder.DropTable(
1542  name: "TeacherReportsScientificWorks");
1543 
1544  migrationBuilder.DropTable(
1545  name: "UserProfilesArticles");
1546 
1547  migrationBuilder.DropTable(
1548  name: "UserProfilesGrants");
1549 
1550  migrationBuilder.DropTable(
1551  name: "UserProfilesPublications");
1552 
1553  migrationBuilder.DropTable(
1554  name: "UserProfilesReportTheses");
1555 
1556  migrationBuilder.DropTable(
1557  name: "UserProfilesScientificInternships");
1558 
1559  migrationBuilder.DropTable(
1560  name: "UserProfilesScientificWorks");
1561 
1562  migrationBuilder.DropTable(
1563  name: "AspNetRoles");
1564 
1565  migrationBuilder.DropTable(
1566  name: "Memberships");
1567 
1568  migrationBuilder.DropTable(
1569  name: "Oppositions");
1570 
1571  migrationBuilder.DropTable(
1572  name: "PatentLicenseActivities");
1573 
1574  migrationBuilder.DropTable(
1575  name: "PostgraduateDissertationGuidances");
1576 
1577  migrationBuilder.DropTable(
1578  name: "PostgraduateGuidances");
1579 
1580  migrationBuilder.DropTable(
1581  name: "Reviews");
1582 
1583  migrationBuilder.DropTable(
1584  name: "ScientificConsultations");
1585 
1586  migrationBuilder.DropTable(
1587  name: "TeacherReports");
1588 
1589  migrationBuilder.DropTable(
1590  name: "Articles");
1591 
1592  migrationBuilder.DropTable(
1593  name: "Grants");
1594 
1595  migrationBuilder.DropTable(
1596  name: "ReportTheses");
1597 
1598  migrationBuilder.DropTable(
1599  name: "ScientificInternships");
1600 
1601  migrationBuilder.DropTable(
1602  name: "ScientificWorks");
1603 
1604  migrationBuilder.DropTable(
1605  name: "Publications");
1606 
1607  migrationBuilder.DropTable(
1608  name: "Conferences");
1609 
1610  migrationBuilder.DropTable(
1611  name: "DepartmentReports");
1612 
1613  migrationBuilder.DropTable(
1614  name: "FacultyReports");
1615 
1616  migrationBuilder.DropTable(
1617  name: "AspNetUsers");
1618 
1619  migrationBuilder.DropTable(
1620  name: "Departments");
1621  }
1622  }
1623 }
override void Down(MigrationBuilder migrationBuilder)
override void Up(MigrationBuilder migrationBuilder)