forked from IoTSharp/IoTSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixe .AsNoTracking()
- Loading branch information
Showing
28 changed files
with
736 additions
and
388 deletions.
There are no files selected for viewing
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
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
18 changes: 9 additions & 9 deletions
18
...ions/ApplicationDbContextModelSnapshot.cs → ..._RemoveDataStorageDateTimeKey.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
113 changes: 113 additions & 0 deletions
113
IoTSharp/Data/Migrations/20200903153304_RemoveDataStorageDateTimeKey.cs
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,113 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace IoTSharp.Migrations | ||
{ | ||
public partial class RemoveDataStorageDateTimeKey : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropPrimaryKey( | ||
name: "PK_DataStorage", | ||
table: "DataStorage"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_DataStorage_Catalog_DeviceId_KeyName", | ||
table: "DataStorage"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_DataStorage_Catalog_DeviceId_KeyName_DateTime", | ||
table: "DataStorage"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "Value_DateTime", | ||
table: "DataStorage", | ||
type: "timestamp with time zone", | ||
nullable: false, | ||
oldClrType: typeof(DateTime), | ||
oldType: "timestamp without time zone"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "DateTime", | ||
table: "DataStorage", | ||
type: "timestamp with time zone", | ||
nullable: false, | ||
oldClrType: typeof(DateTime), | ||
oldType: "timestamp without time zone"); | ||
|
||
migrationBuilder.AddPrimaryKey( | ||
name: "PK_DataStorage", | ||
table: "DataStorage", | ||
columns: new[] { "Catalog", "DeviceId", "KeyName" }); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "TelemetryData", | ||
columns: table => new | ||
{ | ||
DeviceId = table.Column<Guid>(nullable: false), | ||
KeyName = table.Column<string>(nullable: false), | ||
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||
DataSide = table.Column<int>(nullable: false), | ||
Type = table.Column<int>(nullable: false), | ||
Value_Boolean = table.Column<bool>(nullable: false), | ||
Value_String = table.Column<string>(nullable: true), | ||
Value_Long = table.Column<long>(nullable: false), | ||
Value_DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||
Value_Double = table.Column<double>(nullable: false), | ||
Value_Json = table.Column<string>(type: "jsonb", nullable: true), | ||
Value_XML = table.Column<string>(type: "xml", nullable: true), | ||
Value_Binary = table.Column<byte[]>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_TelemetryData", x => new { x.DeviceId, x.KeyName, x.DateTime }); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_TelemetryData_DeviceId_KeyName_DateTime", | ||
table: "TelemetryData", | ||
columns: new[] { "DeviceId", "KeyName", "DateTime" }); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "TelemetryData"); | ||
|
||
migrationBuilder.DropPrimaryKey( | ||
name: "PK_DataStorage", | ||
table: "DataStorage"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "Value_DateTime", | ||
table: "DataStorage", | ||
type: "timestamp without time zone", | ||
nullable: false, | ||
oldClrType: typeof(DateTime), | ||
oldType: "timestamp with time zone"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "DateTime", | ||
table: "DataStorage", | ||
type: "timestamp without time zone", | ||
nullable: false, | ||
oldClrType: typeof(DateTime), | ||
oldType: "timestamp with time zone"); | ||
|
||
migrationBuilder.AddPrimaryKey( | ||
name: "PK_DataStorage", | ||
table: "DataStorage", | ||
columns: new[] { "Catalog", "DeviceId", "KeyName", "DateTime" }); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_DataStorage_Catalog_DeviceId_KeyName", | ||
table: "DataStorage", | ||
columns: new[] { "Catalog", "DeviceId", "KeyName" }); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_DataStorage_Catalog_DeviceId_KeyName_DateTime", | ||
table: "DataStorage", | ||
columns: new[] { "Catalog", "DeviceId", "KeyName", "DateTime" }); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.