1 | using System;
|
---|
2 | using Microsoft.EntityFrameworkCore.Migrations;
|
---|
3 |
|
---|
4 | namespace FarmatikoData.Migrations
|
---|
5 | {
|
---|
6 | public partial class SecondMigration : Migration
|
---|
7 | {
|
---|
8 | protected override void Up(MigrationBuilder migrationBuilder)
|
---|
9 | {
|
---|
10 |
|
---|
11 | }
|
---|
12 |
|
---|
13 | protected override void Down(MigrationBuilder migrationBuilder)
|
---|
14 | {
|
---|
15 | migrationBuilder.DropForeignKey(
|
---|
16 | name: "FK_MedicineLists_Medicines_MedicineId",
|
---|
17 | table: "MedicineLists");
|
---|
18 |
|
---|
19 | migrationBuilder.DropIndex(
|
---|
20 | name: "IX_MedicineLists_MedicineId",
|
---|
21 | table: "MedicineLists");
|
---|
22 |
|
---|
23 | migrationBuilder.DropColumn(
|
---|
24 | name: "MedicineId",
|
---|
25 | table: "MedicineLists");
|
---|
26 |
|
---|
27 | migrationBuilder.AlterColumn<DateTime>(
|
---|
28 | name: "DeletedOn",
|
---|
29 | table: "PharmacyHeads",
|
---|
30 | type: "timestamp without time zone",
|
---|
31 | nullable: false,
|
---|
32 | oldClrType: typeof(DateTime),
|
---|
33 | oldNullable: true);
|
---|
34 |
|
---|
35 | migrationBuilder.AlterColumn<DateTime>(
|
---|
36 | name: "DeletedOn",
|
---|
37 | table: "Pharmacies",
|
---|
38 | type: "timestamp without time zone",
|
---|
39 | nullable: false,
|
---|
40 | oldClrType: typeof(DateTime),
|
---|
41 | oldNullable: true);
|
---|
42 |
|
---|
43 | migrationBuilder.AlterColumn<int>(
|
---|
44 | name: "TotalGlobal",
|
---|
45 | table: "Pandemics",
|
---|
46 | type: "integer",
|
---|
47 | nullable: false,
|
---|
48 | oldClrType: typeof(long));
|
---|
49 |
|
---|
50 | migrationBuilder.AlterColumn<DateTime>(
|
---|
51 | name: "DeletedOn",
|
---|
52 | table: "Pandemics",
|
---|
53 | type: "timestamp without time zone",
|
---|
54 | nullable: false,
|
---|
55 | oldClrType: typeof(DateTime),
|
---|
56 | oldNullable: true);
|
---|
57 |
|
---|
58 | migrationBuilder.AlterColumn<int>(
|
---|
59 | name: "DeathsGlobal",
|
---|
60 | table: "Pandemics",
|
---|
61 | type: "integer",
|
---|
62 | nullable: false,
|
---|
63 | oldClrType: typeof(long));
|
---|
64 |
|
---|
65 | migrationBuilder.AlterColumn<int>(
|
---|
66 | name: "ActiveGlobal",
|
---|
67 | table: "Pandemics",
|
---|
68 | type: "integer",
|
---|
69 | nullable: false,
|
---|
70 | oldClrType: typeof(long));
|
---|
71 |
|
---|
72 | migrationBuilder.AlterColumn<DateTime>(
|
---|
73 | name: "DeletedOn",
|
---|
74 | table: "Medicines",
|
---|
75 | type: "timestamp without time zone",
|
---|
76 | nullable: false,
|
---|
77 | oldClrType: typeof(DateTime),
|
---|
78 | oldNullable: true);
|
---|
79 |
|
---|
80 | migrationBuilder.AddColumn<int>(
|
---|
81 | name: "MedicineListId",
|
---|
82 | table: "Medicines",
|
---|
83 | type: "integer",
|
---|
84 | nullable: true);
|
---|
85 |
|
---|
86 | migrationBuilder.AlterColumn<DateTime>(
|
---|
87 | name: "DeletedOn",
|
---|
88 | table: "MedicineLists",
|
---|
89 | type: "timestamp without time zone",
|
---|
90 | nullable: false,
|
---|
91 | oldClrType: typeof(DateTime),
|
---|
92 | oldNullable: true);
|
---|
93 |
|
---|
94 | migrationBuilder.AddColumn<int>(
|
---|
95 | name: "MedicinesId",
|
---|
96 | table: "MedicineLists",
|
---|
97 | type: "integer",
|
---|
98 | nullable: true);
|
---|
99 |
|
---|
100 | migrationBuilder.AlterColumn<DateTime>(
|
---|
101 | name: "DeletedOn",
|
---|
102 | table: "HealthFacilities",
|
---|
103 | type: "timestamp without time zone",
|
---|
104 | nullable: false,
|
---|
105 | oldClrType: typeof(DateTime),
|
---|
106 | oldNullable: true);
|
---|
107 |
|
---|
108 | migrationBuilder.AlterColumn<DateTime>(
|
---|
109 | name: "DeletedOn",
|
---|
110 | table: "HealthcareWorkers",
|
---|
111 | type: "timestamp without time zone",
|
---|
112 | nullable: false,
|
---|
113 | oldClrType: typeof(DateTime),
|
---|
114 | oldNullable: true);
|
---|
115 |
|
---|
116 | migrationBuilder.CreateIndex(
|
---|
117 | name: "IX_Medicines_MedicineListId",
|
---|
118 | table: "Medicines",
|
---|
119 | column: "MedicineListId");
|
---|
120 |
|
---|
121 | migrationBuilder.CreateIndex(
|
---|
122 | name: "IX_MedicineLists_MedicinesId",
|
---|
123 | table: "MedicineLists",
|
---|
124 | column: "MedicinesId");
|
---|
125 |
|
---|
126 | migrationBuilder.AddForeignKey(
|
---|
127 | name: "FK_MedicineLists_Medicines_MedicinesId",
|
---|
128 | table: "MedicineLists",
|
---|
129 | column: "MedicinesId",
|
---|
130 | principalTable: "Medicines",
|
---|
131 | principalColumn: "Id",
|
---|
132 | onDelete: ReferentialAction.Restrict);
|
---|
133 |
|
---|
134 | migrationBuilder.AddForeignKey(
|
---|
135 | name: "FK_Medicines_MedicineLists_MedicineListId",
|
---|
136 | table: "Medicines",
|
---|
137 | column: "MedicineListId",
|
---|
138 | principalTable: "MedicineLists",
|
---|
139 | principalColumn: "Id",
|
---|
140 | onDelete: ReferentialAction.Restrict);
|
---|
141 | }
|
---|
142 | }
|
---|
143 | }
|
---|