netcore-blueprint 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,21 +30,27 @@ namespace Blueprint.Infra.Migrations
30
30
 
31
31
  MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
32
32
 
33
- b.Property<bool>("Active")
34
- .HasColumnType("tinyint(1)");
35
-
36
- b.Property<DateTime>("CreatedDate")
37
- .HasColumnType("datetime(6)");
33
+ b.Property<string>("Content")
34
+ .HasColumnType("longtext");
38
35
 
39
- b.Property<string>("Description")
36
+ b.Property<string>("CoverImage")
40
37
  .HasColumnType("longtext");
41
38
 
42
- b.Property<DateTime>("LastModifiedDate")
39
+ b.Property<DateTime>("Date")
40
+ .HasColumnType("datetime(6)");
41
+
42
+ b.Property<DateTime>("Modified")
43
43
  .HasColumnType("datetime(6)");
44
44
 
45
45
  b.Property<string>("Name")
46
46
  .HasColumnType("longtext");
47
47
 
48
+ b.Property<bool>("Status")
49
+ .HasColumnType("tinyint(1)");
50
+
51
+ b.Property<string>("Title")
52
+ .HasColumnType("longtext");
53
+
48
54
  b.HasKey("Id");
49
55
 
50
56
  b.ToTable("Category");
@@ -53,18 +59,18 @@ namespace Blueprint.Infra.Migrations
53
59
  new
54
60
  {
55
61
  Id = 1,
56
- Active = true,
57
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3948),
58
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3948),
59
- Name = "Item 1"
62
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6934),
63
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6935),
64
+ Name = "Item 1",
65
+ Status = true
60
66
  },
61
67
  new
62
68
  {
63
69
  Id = 2,
64
- Active = true,
65
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3950),
66
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3950),
67
- Name = "Item 2"
70
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6937),
71
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6937),
72
+ Name = "Item 2",
73
+ Status = true
68
74
  });
69
75
  });
70
76
 
@@ -76,25 +82,28 @@ namespace Blueprint.Infra.Migrations
76
82
 
77
83
  MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
78
84
 
79
- b.Property<bool>("Active")
80
- .HasColumnType("tinyint(1)");
81
-
82
85
  b.Property<int?>("CategoryId")
83
86
  .HasColumnType("int");
84
87
 
85
- b.Property<DateTime>("CreatedDate")
86
- .HasColumnType("datetime(6)");
88
+ b.Property<string>("Content")
89
+ .HasColumnType("longtext");
87
90
 
88
- b.Property<string>("Description")
91
+ b.Property<string>("CoverImage")
89
92
  .HasColumnType("longtext");
90
93
 
91
- b.Property<DateTime>("LastModifiedDate")
94
+ b.Property<DateTime>("Date")
95
+ .HasColumnType("datetime(6)");
96
+
97
+ b.Property<DateTime>("Modified")
92
98
  .HasColumnType("datetime(6)");
93
99
 
94
100
  b.Property<string>("Name")
95
101
  .HasColumnType("longtext");
96
102
 
97
- b.Property<string>("Url")
103
+ b.Property<bool>("Status")
104
+ .HasColumnType("tinyint(1)");
105
+
106
+ b.Property<string>("Title")
98
107
  .HasColumnType("longtext");
99
108
 
100
109
  b.HasKey("Id");
@@ -107,122 +116,122 @@ namespace Blueprint.Infra.Migrations
107
116
  new
108
117
  {
109
118
  Id = 1,
110
- Active = true,
111
119
  CategoryId = 1,
112
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3965),
113
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3965),
120
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
121
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6954),
122
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6954),
114
123
  Name = "Item 1",
115
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png"
124
+ Status = true
116
125
  },
117
126
  new
118
127
  {
119
128
  Id = 2,
120
- Active = true,
121
129
  CategoryId = 2,
122
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3967),
123
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3968),
130
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
131
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6956),
132
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6957),
124
133
  Name = "Item 2",
125
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png"
134
+ Status = true
126
135
  },
127
136
  new
128
137
  {
129
138
  Id = 3,
130
- Active = true,
131
139
  CategoryId = 2,
132
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3969),
133
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3970),
140
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
141
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6959),
142
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6959),
134
143
  Name = "Item 3",
135
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png"
144
+ Status = true
136
145
  },
137
146
  new
138
147
  {
139
148
  Id = 4,
140
- Active = true,
141
149
  CategoryId = 1,
142
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3972),
143
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3972),
150
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
151
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6961),
152
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6962),
144
153
  Name = "Item 4",
145
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg"
154
+ Status = true
146
155
  },
147
156
  new
148
157
  {
149
158
  Id = 5,
150
- Active = true,
151
159
  CategoryId = 2,
152
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3974),
153
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3974),
160
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
161
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6964),
162
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6964),
154
163
  Name = "Item 5",
155
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg"
164
+ Status = true
156
165
  },
157
166
  new
158
167
  {
159
168
  Id = 6,
160
- Active = true,
161
169
  CategoryId = 2,
162
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3976),
163
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3976),
170
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg",
171
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6966),
172
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6966),
164
173
  Name = "Item 6",
165
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg"
174
+ Status = true
166
175
  },
167
176
  new
168
177
  {
169
178
  Id = 7,
170
- Active = true,
171
179
  CategoryId = 1,
172
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3978),
173
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3979),
180
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg",
181
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6968),
182
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6969),
174
183
  Name = "Item 7",
175
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg"
184
+ Status = true
176
185
  },
177
186
  new
178
187
  {
179
188
  Id = 8,
180
- Active = true,
181
189
  CategoryId = 2,
182
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3980),
183
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3981),
190
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
191
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6971),
192
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6971),
184
193
  Name = "Item 8",
185
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png"
194
+ Status = true
186
195
  },
187
196
  new
188
197
  {
189
198
  Id = 9,
190
- Active = true,
191
199
  CategoryId = 2,
192
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3982),
193
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3983),
200
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
201
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6973),
202
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6973),
194
203
  Name = "Item 9",
195
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png"
204
+ Status = true
196
205
  },
197
206
  new
198
207
  {
199
208
  Id = 10,
200
- Active = true,
201
209
  CategoryId = 1,
202
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3985),
203
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3985),
210
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
211
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6975),
212
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6976),
204
213
  Name = "Item 10",
205
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png"
214
+ Status = true
206
215
  },
207
216
  new
208
217
  {
209
218
  Id = 11,
210
- Active = true,
211
219
  CategoryId = 2,
212
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3987),
213
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3987),
220
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
221
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6978),
222
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6978),
214
223
  Name = "Item 11",
215
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg"
224
+ Status = true
216
225
  },
217
226
  new
218
227
  {
219
228
  Id = 12,
220
- Active = true,
221
229
  CategoryId = 2,
222
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3989),
223
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3989),
230
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
231
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6980),
232
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6980),
224
233
  Name = "Item 12",
225
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg"
234
+ Status = true
226
235
  });
227
236
  });
228
237
 
@@ -234,16 +243,13 @@ namespace Blueprint.Infra.Migrations
234
243
 
235
244
  MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
236
245
 
237
- b.Property<bool>("Active")
238
- .HasColumnType("tinyint(1)");
239
-
240
- b.Property<DateTime>("CreatedDate")
246
+ b.Property<DateTime>("Date")
241
247
  .HasColumnType("datetime(6)");
242
248
 
243
249
  b.Property<string>("Email")
244
250
  .HasColumnType("longtext");
245
251
 
246
- b.Property<DateTime>("LastModifiedDate")
252
+ b.Property<DateTime>("Modified")
247
253
  .HasColumnType("datetime(6)");
248
254
 
249
255
  b.Property<string>("Name")
@@ -255,6 +261,9 @@ namespace Blueprint.Infra.Migrations
255
261
  b.Property<int>("Role")
256
262
  .HasColumnType("int");
257
263
 
264
+ b.Property<bool>("Status")
265
+ .HasColumnType("tinyint(1)");
266
+
258
267
  b.HasKey("Id");
259
268
 
260
269
  b.ToTable("User");
@@ -263,32 +272,32 @@ namespace Blueprint.Infra.Migrations
263
272
  new
264
273
  {
265
274
  Id = 1,
266
- Active = true,
267
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3853),
275
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6827),
268
276
  Email = "",
269
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3854),
277
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6827),
270
278
  Name = "Test",
271
- Role = 0
279
+ Role = 0,
280
+ Status = true
272
281
  },
273
282
  new
274
283
  {
275
284
  Id = 2,
276
- Active = true,
277
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3856),
285
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6830),
278
286
  Email = "truongdxfx08031@funix.edu.vn",
279
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3857),
287
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6830),
280
288
  Name = "Truong Dang",
281
- Role = 0
289
+ Role = 0,
290
+ Status = true
282
291
  },
283
292
  new
284
293
  {
285
294
  Id = 3,
286
- Active = true,
287
- CreatedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3859),
295
+ Date = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6832),
288
296
  Email = "truonghusk17aws1@gmail.com",
289
- LastModifiedDate = new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3859),
297
+ Modified = new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6833),
290
298
  Name = "Thai Son",
291
- Role = 0
299
+ Role = 0,
300
+ Status = true
292
301
  });
293
302
  });
294
303
 
@@ -42,7 +42,7 @@ namespace Blueprint.Infra.Services
42
42
  try
43
43
  {
44
44
  List<T> items = _dbSet.Where(p => ids.Contains(p.Id)).ToList();
45
- items.ForEach(i => i.Active = false);
45
+ items.ForEach(i => i.Status = false);
46
46
  _dbSet.UpdateRange(items);
47
47
  await _dbContext.SaveChangesAsync();
48
48
  }
@@ -82,7 +82,7 @@ namespace Blueprint.Infra.Services
82
82
  {
83
83
  int skipValues = (pagingParams.Page - 1) * pagingParams.Per_Page;
84
84
  IQueryable<T> query = _dbSet
85
- .Where(p => p.Active == true)
85
+ .Where(p => p.Status == true)
86
86
  .OrderByDescending(p => p.Id);
87
87
 
88
88
  // Apply includes dynamically
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netcore-blueprint",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "A custom .NET Core project blueprint",
5
5
  "main": "create.js",
6
6
  "bin": {
@@ -1,10 +0,0 @@
1
- namespace Blueprint.Core.Dtos.Others
2
- {
3
- public class BaseDto
4
- {
5
- /// <summary>
6
- /// Id
7
- /// </summary>
8
- public int? Id { get; set; }
9
- }
10
- }
@@ -1,149 +0,0 @@
1
- using System;
2
- using Microsoft.EntityFrameworkCore.Metadata;
3
- using Microsoft.EntityFrameworkCore.Migrations;
4
-
5
- #nullable disable
6
-
7
- #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
8
-
9
- namespace Blueprint.Infra.Migrations
10
- {
11
- /// <inheritdoc />
12
- public partial class InitialCreate : Migration
13
- {
14
- /// <inheritdoc />
15
- protected override void Up(MigrationBuilder migrationBuilder)
16
- {
17
- migrationBuilder.AlterDatabase()
18
- .Annotation("MySql:CharSet", "utf8mb4");
19
-
20
- migrationBuilder.CreateTable(
21
- name: "Category",
22
- columns: table => new
23
- {
24
- Id = table.Column<int>(type: "int", nullable: false)
25
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
26
- Name = table.Column<string>(type: "longtext", nullable: true)
27
- .Annotation("MySql:CharSet", "utf8mb4"),
28
- Description = table.Column<string>(type: "longtext", nullable: true)
29
- .Annotation("MySql:CharSet", "utf8mb4"),
30
- Active = table.Column<bool>(type: "tinyint(1)", nullable: false),
31
- CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
32
- LastModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
33
- },
34
- constraints: table =>
35
- {
36
- table.PrimaryKey("PK_Category", x => x.Id);
37
- })
38
- .Annotation("MySql:CharSet", "utf8mb4");
39
-
40
- migrationBuilder.CreateTable(
41
- name: "User",
42
- columns: table => new
43
- {
44
- Id = table.Column<int>(type: "int", nullable: false)
45
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
46
- Name = table.Column<string>(type: "longtext", nullable: true)
47
- .Annotation("MySql:CharSet", "utf8mb4"),
48
- Email = table.Column<string>(type: "longtext", nullable: true)
49
- .Annotation("MySql:CharSet", "utf8mb4"),
50
- Picture = table.Column<string>(type: "longtext", nullable: true)
51
- .Annotation("MySql:CharSet", "utf8mb4"),
52
- Role = table.Column<int>(type: "int", nullable: false),
53
- Active = table.Column<bool>(type: "tinyint(1)", nullable: false),
54
- CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
55
- LastModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
56
- },
57
- constraints: table =>
58
- {
59
- table.PrimaryKey("PK_User", x => x.Id);
60
- })
61
- .Annotation("MySql:CharSet", "utf8mb4");
62
-
63
- migrationBuilder.CreateTable(
64
- name: "Product",
65
- columns: table => new
66
- {
67
- Id = table.Column<int>(type: "int", nullable: false)
68
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
69
- Name = table.Column<string>(type: "longtext", nullable: true)
70
- .Annotation("MySql:CharSet", "utf8mb4"),
71
- Url = table.Column<string>(type: "longtext", nullable: true)
72
- .Annotation("MySql:CharSet", "utf8mb4"),
73
- Description = table.Column<string>(type: "longtext", nullable: true)
74
- .Annotation("MySql:CharSet", "utf8mb4"),
75
- CategoryId = table.Column<int>(type: "int", nullable: true),
76
- Active = table.Column<bool>(type: "tinyint(1)", nullable: false),
77
- CreatedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
78
- LastModifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
79
- },
80
- constraints: table =>
81
- {
82
- table.PrimaryKey("PK_Product", x => x.Id);
83
- table.ForeignKey(
84
- name: "FK_Product_Category_CategoryId",
85
- column: x => x.CategoryId,
86
- principalTable: "Category",
87
- principalColumn: "Id",
88
- onDelete: ReferentialAction.Cascade);
89
- })
90
- .Annotation("MySql:CharSet", "utf8mb4");
91
-
92
- migrationBuilder.InsertData(
93
- table: "Category",
94
- columns: new[] { "Id", "Active", "CreatedDate", "Description", "LastModifiedDate", "Name" },
95
- values: new object[,]
96
- {
97
- { 1, true, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3948), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3948), "Item 1" },
98
- { 2, true, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3950), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3950), "Item 2" }
99
- });
100
-
101
- migrationBuilder.InsertData(
102
- table: "User",
103
- columns: new[] { "Id", "Active", "CreatedDate", "Email", "LastModifiedDate", "Name", "Picture", "Role" },
104
- values: new object[,]
105
- {
106
- { 1, true, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3853), "", new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3854), "Test", null, 0 },
107
- { 2, true, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3856), "truongdxfx08031@funix.edu.vn", new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3857), "Truong Dang", null, 0 },
108
- { 3, true, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3859), "truonghusk17aws1@gmail.com", new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3859), "Thai Son", null, 0 }
109
- });
110
-
111
- migrationBuilder.InsertData(
112
- table: "Product",
113
- columns: new[] { "Id", "Active", "CategoryId", "CreatedDate", "Description", "LastModifiedDate", "Name", "Url" },
114
- values: new object[,]
115
- {
116
- { 1, true, 1, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3965), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3965), "Item 1", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png" },
117
- { 2, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3967), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3968), "Item 2", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png" },
118
- { 3, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3969), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3970), "Item 3", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png" },
119
- { 4, true, 1, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3972), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3972), "Item 4", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg" },
120
- { 5, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3974), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3974), "Item 5", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg" },
121
- { 6, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3976), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3976), "Item 6", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg" },
122
- { 7, true, 1, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3978), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3979), "Item 7", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg" },
123
- { 8, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3980), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3981), "Item 8", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png" },
124
- { 9, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3982), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3983), "Item 9", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png" },
125
- { 10, true, 1, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3985), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3985), "Item 10", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png" },
126
- { 11, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3987), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3987), "Item 11", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg" },
127
- { 12, true, 2, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3989), null, new DateTime(2025, 4, 1, 21, 34, 58, 114, DateTimeKind.Local).AddTicks(3989), "Item 12", "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg" }
128
- });
129
-
130
- migrationBuilder.CreateIndex(
131
- name: "IX_Product_CategoryId",
132
- table: "Product",
133
- column: "CategoryId");
134
- }
135
-
136
- /// <inheritdoc />
137
- protected override void Down(MigrationBuilder migrationBuilder)
138
- {
139
- migrationBuilder.DropTable(
140
- name: "Product");
141
-
142
- migrationBuilder.DropTable(
143
- name: "User");
144
-
145
- migrationBuilder.DropTable(
146
- name: "Category");
147
- }
148
- }
149
- }