Last change
on this file was a569b7c, checked in by Danilo <danilo.najkov@…>, 2 years ago |
todo items full functionality
|
-
Property mode
set to
100644
|
File size:
1.8 KB
|
Line | |
---|
1 | using Microsoft.EntityFrameworkCore.Migrations;
|
---|
2 |
|
---|
3 | #nullable disable
|
---|
4 |
|
---|
5 | namespace backend.Migrations
|
---|
6 | {
|
---|
7 | public partial class ToDoItemsnullablereview : Migration
|
---|
8 | {
|
---|
9 | protected override void Up(MigrationBuilder migrationBuilder)
|
---|
10 | {
|
---|
11 | migrationBuilder.DropForeignKey(
|
---|
12 | name: "FK_ToDoItems_Reviews_LinkedReviewId",
|
---|
13 | table: "ToDoItems");
|
---|
14 |
|
---|
15 | migrationBuilder.AlterColumn<int>(
|
---|
16 | name: "LinkedReviewId",
|
---|
17 | table: "ToDoItems",
|
---|
18 | type: "integer",
|
---|
19 | nullable: true,
|
---|
20 | oldClrType: typeof(int),
|
---|
21 | oldType: "integer");
|
---|
22 |
|
---|
23 | migrationBuilder.AddForeignKey(
|
---|
24 | name: "FK_ToDoItems_Reviews_LinkedReviewId",
|
---|
25 | table: "ToDoItems",
|
---|
26 | column: "LinkedReviewId",
|
---|
27 | principalTable: "Reviews",
|
---|
28 | principalColumn: "Id");
|
---|
29 | }
|
---|
30 |
|
---|
31 | protected override void Down(MigrationBuilder migrationBuilder)
|
---|
32 | {
|
---|
33 | migrationBuilder.DropForeignKey(
|
---|
34 | name: "FK_ToDoItems_Reviews_LinkedReviewId",
|
---|
35 | table: "ToDoItems");
|
---|
36 |
|
---|
37 | migrationBuilder.AlterColumn<int>(
|
---|
38 | name: "LinkedReviewId",
|
---|
39 | table: "ToDoItems",
|
---|
40 | type: "integer",
|
---|
41 | nullable: false,
|
---|
42 | defaultValue: 0,
|
---|
43 | oldClrType: typeof(int),
|
---|
44 | oldType: "integer",
|
---|
45 | oldNullable: true);
|
---|
46 |
|
---|
47 | migrationBuilder.AddForeignKey(
|
---|
48 | name: "FK_ToDoItems_Reviews_LinkedReviewId",
|
---|
49 | table: "ToDoItems",
|
---|
50 | column: "LinkedReviewId",
|
---|
51 | principalTable: "Reviews",
|
---|
52 | principalColumn: "Id",
|
---|
53 | onDelete: ReferentialAction.Cascade);
|
---|
54 | }
|
---|
55 | }
|
---|
56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.