1
|
using System;
|
2
|
using Microsoft.EntityFrameworkCore.Migrations;
|
3
|
|
4
|
#nullable disable
|
5
|
|
6
|
namespace RestAPI.Migrations
|
7
|
{
|
8
|
public partial class V3 : Migration
|
9
|
{
|
10
|
protected override void Up(MigrationBuilder migrationBuilder)
|
11
|
{
|
12
|
migrationBuilder.DropForeignKey(
|
13
|
name: "FK_Documents_DocumentContents_ContentId",
|
14
|
table: "Documents");
|
15
|
|
16
|
migrationBuilder.DropForeignKey(
|
17
|
name: "FK_Documents_Users_UserAddedId",
|
18
|
table: "Documents");
|
19
|
|
20
|
migrationBuilder.AlterColumn<string>(
|
21
|
name: "Username",
|
22
|
table: "Users",
|
23
|
type: "text",
|
24
|
nullable: true,
|
25
|
oldClrType: typeof(string),
|
26
|
oldType: "text");
|
27
|
|
28
|
migrationBuilder.AlterColumn<string>(
|
29
|
name: "Surname",
|
30
|
table: "Users",
|
31
|
type: "text",
|
32
|
nullable: true,
|
33
|
oldClrType: typeof(string),
|
34
|
oldType: "text");
|
35
|
|
36
|
migrationBuilder.AlterColumn<string>(
|
37
|
name: "Password",
|
38
|
table: "Users",
|
39
|
type: "text",
|
40
|
nullable: true,
|
41
|
oldClrType: typeof(string),
|
42
|
oldType: "text");
|
43
|
|
44
|
migrationBuilder.AlterColumn<string>(
|
45
|
name: "Name",
|
46
|
table: "Users",
|
47
|
type: "text",
|
48
|
nullable: true,
|
49
|
oldClrType: typeof(string),
|
50
|
oldType: "text");
|
51
|
|
52
|
migrationBuilder.AlterColumn<string>(
|
53
|
name: "Name",
|
54
|
table: "TagCategories",
|
55
|
type: "text",
|
56
|
nullable: true,
|
57
|
oldClrType: typeof(string),
|
58
|
oldType: "text");
|
59
|
|
60
|
migrationBuilder.AlterColumn<string>(
|
61
|
name: "Description",
|
62
|
table: "TagCategories",
|
63
|
type: "text",
|
64
|
nullable: true,
|
65
|
oldClrType: typeof(string),
|
66
|
oldType: "text");
|
67
|
|
68
|
migrationBuilder.AlterColumn<string>(
|
69
|
name: "Color",
|
70
|
table: "TagCategories",
|
71
|
type: "text",
|
72
|
nullable: true,
|
73
|
oldClrType: typeof(string),
|
74
|
oldType: "text");
|
75
|
|
76
|
migrationBuilder.AlterColumn<Guid>(
|
77
|
name: "UserAddedId",
|
78
|
table: "Documents",
|
79
|
type: "uuid",
|
80
|
nullable: true,
|
81
|
oldClrType: typeof(Guid),
|
82
|
oldType: "uuid");
|
83
|
|
84
|
migrationBuilder.AlterColumn<string>(
|
85
|
name: "Name",
|
86
|
table: "Documents",
|
87
|
type: "text",
|
88
|
nullable: true,
|
89
|
oldClrType: typeof(string),
|
90
|
oldType: "text");
|
91
|
|
92
|
migrationBuilder.AlterColumn<Guid>(
|
93
|
name: "ContentId",
|
94
|
table: "Documents",
|
95
|
type: "uuid",
|
96
|
nullable: true,
|
97
|
oldClrType: typeof(Guid),
|
98
|
oldType: "uuid");
|
99
|
|
100
|
migrationBuilder.AlterColumn<Guid>(
|
101
|
name: "Instance",
|
102
|
table: "AnnotationTags",
|
103
|
type: "uuid",
|
104
|
nullable: false,
|
105
|
oldClrType: typeof(int),
|
106
|
oldType: "integer");
|
107
|
|
108
|
migrationBuilder.AddForeignKey(
|
109
|
name: "FK_Documents_DocumentContents_ContentId",
|
110
|
table: "Documents",
|
111
|
column: "ContentId",
|
112
|
principalTable: "DocumentContents",
|
113
|
principalColumn: "Id");
|
114
|
|
115
|
migrationBuilder.AddForeignKey(
|
116
|
name: "FK_Documents_Users_UserAddedId",
|
117
|
table: "Documents",
|
118
|
column: "UserAddedId",
|
119
|
principalTable: "Users",
|
120
|
principalColumn: "Id");
|
121
|
}
|
122
|
|
123
|
protected override void Down(MigrationBuilder migrationBuilder)
|
124
|
{
|
125
|
migrationBuilder.DropForeignKey(
|
126
|
name: "FK_Documents_DocumentContents_ContentId",
|
127
|
table: "Documents");
|
128
|
|
129
|
migrationBuilder.DropForeignKey(
|
130
|
name: "FK_Documents_Users_UserAddedId",
|
131
|
table: "Documents");
|
132
|
|
133
|
migrationBuilder.AlterColumn<string>(
|
134
|
name: "Username",
|
135
|
table: "Users",
|
136
|
type: "text",
|
137
|
nullable: false,
|
138
|
defaultValue: "",
|
139
|
oldClrType: typeof(string),
|
140
|
oldType: "text",
|
141
|
oldNullable: true);
|
142
|
|
143
|
migrationBuilder.AlterColumn<string>(
|
144
|
name: "Surname",
|
145
|
table: "Users",
|
146
|
type: "text",
|
147
|
nullable: false,
|
148
|
defaultValue: "",
|
149
|
oldClrType: typeof(string),
|
150
|
oldType: "text",
|
151
|
oldNullable: true);
|
152
|
|
153
|
migrationBuilder.AlterColumn<string>(
|
154
|
name: "Password",
|
155
|
table: "Users",
|
156
|
type: "text",
|
157
|
nullable: false,
|
158
|
defaultValue: "",
|
159
|
oldClrType: typeof(string),
|
160
|
oldType: "text",
|
161
|
oldNullable: true);
|
162
|
|
163
|
migrationBuilder.AlterColumn<string>(
|
164
|
name: "Name",
|
165
|
table: "Users",
|
166
|
type: "text",
|
167
|
nullable: false,
|
168
|
defaultValue: "",
|
169
|
oldClrType: typeof(string),
|
170
|
oldType: "text",
|
171
|
oldNullable: true);
|
172
|
|
173
|
migrationBuilder.AlterColumn<string>(
|
174
|
name: "Name",
|
175
|
table: "TagCategories",
|
176
|
type: "text",
|
177
|
nullable: false,
|
178
|
defaultValue: "",
|
179
|
oldClrType: typeof(string),
|
180
|
oldType: "text",
|
181
|
oldNullable: true);
|
182
|
|
183
|
migrationBuilder.AlterColumn<string>(
|
184
|
name: "Description",
|
185
|
table: "TagCategories",
|
186
|
type: "text",
|
187
|
nullable: false,
|
188
|
defaultValue: "",
|
189
|
oldClrType: typeof(string),
|
190
|
oldType: "text",
|
191
|
oldNullable: true);
|
192
|
|
193
|
migrationBuilder.AlterColumn<string>(
|
194
|
name: "Color",
|
195
|
table: "TagCategories",
|
196
|
type: "text",
|
197
|
nullable: false,
|
198
|
defaultValue: "",
|
199
|
oldClrType: typeof(string),
|
200
|
oldType: "text",
|
201
|
oldNullable: true);
|
202
|
|
203
|
migrationBuilder.AlterColumn<Guid>(
|
204
|
name: "UserAddedId",
|
205
|
table: "Documents",
|
206
|
type: "uuid",
|
207
|
nullable: false,
|
208
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
209
|
oldClrType: typeof(Guid),
|
210
|
oldType: "uuid",
|
211
|
oldNullable: true);
|
212
|
|
213
|
migrationBuilder.AlterColumn<string>(
|
214
|
name: "Name",
|
215
|
table: "Documents",
|
216
|
type: "text",
|
217
|
nullable: false,
|
218
|
defaultValue: "",
|
219
|
oldClrType: typeof(string),
|
220
|
oldType: "text",
|
221
|
oldNullable: true);
|
222
|
|
223
|
migrationBuilder.AlterColumn<Guid>(
|
224
|
name: "ContentId",
|
225
|
table: "Documents",
|
226
|
type: "uuid",
|
227
|
nullable: false,
|
228
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
229
|
oldClrType: typeof(Guid),
|
230
|
oldType: "uuid",
|
231
|
oldNullable: true);
|
232
|
|
233
|
migrationBuilder.AlterColumn<int>(
|
234
|
name: "Instance",
|
235
|
table: "AnnotationTags",
|
236
|
type: "integer",
|
237
|
nullable: false,
|
238
|
oldClrType: typeof(Guid),
|
239
|
oldType: "uuid");
|
240
|
|
241
|
migrationBuilder.AddForeignKey(
|
242
|
name: "FK_Documents_DocumentContents_ContentId",
|
243
|
table: "Documents",
|
244
|
column: "ContentId",
|
245
|
principalTable: "DocumentContents",
|
246
|
principalColumn: "Id",
|
247
|
onDelete: ReferentialAction.Cascade);
|
248
|
|
249
|
migrationBuilder.AddForeignKey(
|
250
|
name: "FK_Documents_Users_UserAddedId",
|
251
|
table: "Documents",
|
252
|
column: "UserAddedId",
|
253
|
principalTable: "Users",
|
254
|
principalColumn: "Id",
|
255
|
onDelete: ReferentialAction.Cascade);
|
256
|
}
|
257
|
}
|
258
|
}
|