Skip to content

Commit

Permalink
[HER-47] Migrate initial detections (#27)
Browse files Browse the repository at this point in the history
* [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
TBiannca authored Jul 9, 2021
1 parent 17f43cc commit 0492eba
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/Data/Migrations/20210709123630_InsertData.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

217 changes: 217 additions & 0 deletions src/Data/Migrations/20210709123630_InsertData.cs
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);
}
}
}
4 changes: 4 additions & 0 deletions src/Presentation/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
namespace Presentation
{
using System.Collections;
using System.Collections.Generic;
using Business.Detection.Common.Models;
using Business.Detection.Fetching.Commands;
using Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
Expand Down
2 changes: 2 additions & 0 deletions src/Style/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public static class Check
{
public const string CA1707 = "CA1707";
public const string CA1724 = "CA1724";
public const string SA1118 = "SA1118";
public const string CA1814 = "CA1814";
public const string CA1052 = "CA1052";
}
}

0 comments on commit 0492eba

Please sign in to comment.