-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HER-47] Migrate initial detections (#27)
* [HER-47] Add more checks * [HER-47] Change Context * [HER-47] Add migration * [HER-47] Follow-up Add more data * [HER-47] Remove unused System * [HER-47] Change Down func in migration * [HER-47] Remove paranthesis
- Loading branch information
Showing
4 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
namespace Data.Migrations | ||
{ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using MySql.EntityFrameworkCore.Metadata; | ||
using Style; | ||
|
||
[SuppressMessage(Category.Default, Check.SA1118, Justification = Reason.Autogenerated)] | ||
[SuppressMessage(Category.Default, Check.CA1814, Justification = Reason.Autogenerated)] | ||
|
||
public partial class InsertData : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.InsertData( | ||
table: "Detections", | ||
columns: new[] { "Id", "Class", "Score", "Timestamp" }, | ||
values: new object[,] | ||
{ | ||
{ 1, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6134) }, | ||
{ 2, "pet", 5, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6477) }, | ||
{ 3, "glass", 8, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6478) }, | ||
{ 4, "pet", 4, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6479) }, | ||
{ 5, "clothing", 3, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6480) }, | ||
{ 6, "plastic", 9, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 7, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 8, "clothing", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6482) }, | ||
{ 9, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6134) }, | ||
{ 10, "pet", 5, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6477) }, | ||
{ 11, "clothing", 8, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6478) }, | ||
{ 12, "glass", 4, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6479) }, | ||
{ 13, "pet", 3, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6480) }, | ||
{ 14, "glass", 9, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 15, "plastic", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 16, "plastic", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6482) }, | ||
{ 17, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6134) }, | ||
{ 18, "pet", 5, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6477) }, | ||
{ 19, "glass", 8, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6478) }, | ||
{ 20, "pet", 4, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6479) }, | ||
{ 21, "clothing", 3, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6480) }, | ||
{ 22, "plastic", 9, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 23, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 24, "clothing", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6482) }, | ||
{ 25, "pet", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6134) }, | ||
{ 26, "pet", 5, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6477) }, | ||
{ 27, "clothing", 8, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6478) }, | ||
{ 28, "glass", 4, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6479) }, | ||
{ 29, "pet", 3, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6480) }, | ||
{ 30, "glass", 9, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 31, "plastic", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6481) }, | ||
{ 32, "plastic", 1, new DateTime(2021, 7, 9, 11, 36, 1, 502, DateTimeKind.Utc).AddTicks(6482) }, | ||
}); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 1); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 2); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 3); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 4); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 5); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 6); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 7); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 8); | ||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 9); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 10); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 11); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 12); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 13); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 14); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 15); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 16); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 17); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 18); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 19); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 20); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 21); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 22); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 23); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 24); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 25); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 26); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 27); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 28); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 29); | ||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 30); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 31); | ||
|
||
migrationBuilder.DeleteData( | ||
table: "Detections", | ||
keyColumn: "Id", | ||
keyValue: 32); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters