Added devices ZIndex

This commit is contained in:
SpoinkyNL committed 2019-10-13 22:48:02 +02:00
1 parent 44549f86aa
commit 1ae103accc
9 files changed
+172 -44

No files matched your search

@@ -1,22 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities
{
public class SurfaceDeviceEntity
{
[Key]
public string Guid { get; set; }
public int DeviceId { get; set; }
public string DeviceName { get; set; }
public string DeviceModel { get; set; }
public string DeviceManufacturer { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Rotation { get; set; }
public string SurfaceId { get; set; }
public virtual SurfaceEntity Surface { get; set; }
}
}
@@ -15,6 +15,7 @@ namespace Artemis.Storage.Entities
public double X { get; set; }
public double Y { get; set; }
public double Rotation { get; set; }
public int ZIndex { get; set; }
public string SurfaceId { get; set; }
public virtual SurfaceEntity Surface { get; set; }
@@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
[Migration("20190429131614_InitialCreate")]
[Migration("20191013153102_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -95,9 +95,7 @@ namespace Artemis.Storage.Migrations
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerGuid");
b.Property<int>("LayerId");
b.Property<string>("LayerId");
b.Property<string>("LedName");
@@ -105,7 +103,7 @@ namespace Artemis.Storage.Migrations
b.HasKey("Guid");
b.HasIndex("LayerGuid");
b.HasIndex("LayerId");
b.ToTable("Leds");
});
@@ -155,6 +153,50 @@ namespace Artemis.Storage.Migrations
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfaceEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<bool>("IsActive");
b.Property<string>("Name");
b.HasKey("Guid");
b.ToTable("Surfaces");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfacePositionEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int>("DeviceId");
b.Property<string>("DeviceManufacturer");
b.Property<string>("DeviceModel");
b.Property<string>("DeviceName");
b.Property<double>("Rotation");
b.Property<string>("SurfaceId");
b.Property<double>("X");
b.Property<double>("Y");
b.Property<int>("ZIndex");
b.HasKey("Guid");
b.HasIndex("SurfaceId");
b.ToTable("SurfacePositionEntity");
});
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
@@ -187,7 +229,7 @@ namespace Artemis.Storage.Migrations
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerGuid");
.HasForeignKey("LayerId");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
@@ -196,6 +238,13 @@ namespace Artemis.Storage.Migrations
.WithMany()
.HasForeignKey("RootFolderGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfacePositionEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.SurfaceEntity", "Surface")
.WithMany("SurfacePositions")
.HasForeignKey("SurfaceId");
});
#pragma warning restore 612, 618
}
}
@@ -52,6 +52,19 @@ namespace Artemis.Storage.Migrations
table.PrimaryKey("PK_Settings", x => x.Name);
});
migrationBuilder.CreateTable(
name: "Surfaces",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: true),
IsActive = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Surfaces", x => x.Guid);
});
migrationBuilder.CreateTable(
name: "Layers",
columns: table => new
@@ -93,6 +106,32 @@ namespace Artemis.Storage.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "SurfacePositionEntity",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
DeviceId = table.Column<int>(nullable: false),
DeviceName = table.Column<string>(nullable: true),
DeviceModel = table.Column<string>(nullable: true),
DeviceManufacturer = table.Column<string>(nullable: true),
X = table.Column<double>(nullable: false),
Y = table.Column<double>(nullable: false),
Rotation = table.Column<double>(nullable: false),
ZIndex = table.Column<int>(nullable: false),
SurfaceId = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SurfacePositionEntity", x => x.Guid);
table.ForeignKey(
name: "FK_SurfacePositionEntity_Surfaces_SurfaceId",
column: x => x.SurfaceId,
principalTable: "Surfaces",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "LayerSettings",
columns: table => new
@@ -120,15 +159,14 @@ namespace Artemis.Storage.Migrations
Guid = table.Column<string>(nullable: false),
LedName = table.Column<string>(nullable: true),
LimitedToDevice = table.Column<string>(nullable: true),
LayerId = table.Column<int>(nullable: false),
LayerGuid = table.Column<string>(nullable: true)
LayerId = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Leds", x => x.Guid);
table.ForeignKey(
name: "FK_Leds_Layers_LayerGuid",
column: x => x.LayerGuid,
name: "FK_Leds_Layers_LayerId",
column: x => x.LayerId,
principalTable: "Layers",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
@@ -175,14 +213,19 @@ namespace Artemis.Storage.Migrations
column: "LayerEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Leds_LayerGuid",
name: "IX_Leds_LayerId",
table: "Leds",
column: "LayerGuid");
column: "LayerId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_RootFolderGuid",
table: "Profiles",
column: "RootFolderGuid");
migrationBuilder.CreateIndex(
name: "IX_SurfacePositionEntity_SurfaceId",
table: "SurfacePositionEntity",
column: "SurfaceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
@@ -202,9 +245,15 @@ namespace Artemis.Storage.Migrations
migrationBuilder.DropTable(
name: "Settings");
migrationBuilder.DropTable(
name: "SurfacePositionEntity");
migrationBuilder.DropTable(
name: "LayerSettings");
migrationBuilder.DropTable(
name: "Surfaces");
migrationBuilder.DropTable(
name: "Layers");
@@ -93,9 +93,7 @@ namespace Artemis.Storage.Migrations
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerGuid");
b.Property<int>("LayerId");
b.Property<string>("LayerId");
b.Property<string>("LedName");
@@ -103,7 +101,7 @@ namespace Artemis.Storage.Migrations
b.HasKey("Guid");
b.HasIndex("LayerGuid");
b.HasIndex("LayerId");
b.ToTable("Leds");
});
@@ -153,6 +151,50 @@ namespace Artemis.Storage.Migrations
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfaceEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<bool>("IsActive");
b.Property<string>("Name");
b.HasKey("Guid");
b.ToTable("Surfaces");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfacePositionEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int>("DeviceId");
b.Property<string>("DeviceManufacturer");
b.Property<string>("DeviceModel");
b.Property<string>("DeviceName");
b.Property<double>("Rotation");
b.Property<string>("SurfaceId");
b.Property<double>("X");
b.Property<double>("Y");
b.Property<int>("ZIndex");
b.HasKey("Guid");
b.HasIndex("SurfaceId");
b.ToTable("SurfacePositionEntity");
});
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
@@ -185,7 +227,7 @@ namespace Artemis.Storage.Migrations
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerGuid");
.HasForeignKey("LayerId");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
@@ -194,6 +236,13 @@ namespace Artemis.Storage.Migrations
.WithMany()
.HasForeignKey("RootFolderGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfacePositionEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.SurfaceEntity", "Surface")
.WithMany("SurfacePositions")
.HasForeignKey("SurfaceId");
});
#pragma warning restore 612, 618
}
}