mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Meta - Update dependencies
This commit is contained in:
1 parent
df95e64567
commit
cfdcbe44c9
16 files changed
+418
-84
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
<Platforms>x64</Platforms>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@@ -8,6 +8,7 @@ using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.Storage.Entities.Surface;
|
||||
using Artemis.Storage.Entities.Workshop;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
|
||||
namespace Artemis.Storage;
|
||||
|
||||
@@ -35,9 +36,17 @@ public class ArtemisDbContext : DbContext
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<DeviceEntity>()
|
||||
.OwnsOne(d => d.InputIdentifiers, builder => builder.ToJson())
|
||||
.OwnsOne(d => d.InputMappings, builder => builder.ToJson());
|
||||
|
||||
.Property(e => e.InputIdentifiers)
|
||||
.HasConversion(
|
||||
v => JsonSerializer.Serialize(v, JsonSerializerOptions),
|
||||
v => JsonSerializer.Deserialize<List<DeviceInputIdentifierEntity>>(v, JsonSerializerOptions) ?? new List<DeviceInputIdentifierEntity>());
|
||||
|
||||
modelBuilder.Entity<DeviceEntity>()
|
||||
.Property(e => e.InputMappings)
|
||||
.HasConversion(
|
||||
v => JsonSerializer.Serialize(v, JsonSerializerOptions),
|
||||
v => JsonSerializer.Deserialize<List<InputMappingEntity>>(v, JsonSerializerOptions) ?? new List<InputMappingEntity>());
|
||||
|
||||
modelBuilder.Entity<EntryEntity>()
|
||||
.Property(e => e.Metadata)
|
||||
.HasConversion(
|
||||
|
||||
+337
@@ -0,0 +1,337 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Artemis.Storage;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
[DbContext(typeof(ArtemisDbContext))]
|
||||
[Migration("20250204194848_DevicesClearBrokenJson")]
|
||||
partial class DevicesClearBrokenJson
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.General.ReleaseEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset?>("InstalledAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Version")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("InstalledAt");
|
||||
|
||||
b.HasIndex("Version")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Releases");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("PluginGuid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PluginGuid")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Plugins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginFeatureEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid?>("PluginEntityId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PluginEntityId");
|
||||
|
||||
b.ToTable("PluginFeatures");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginSettingEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("PluginGuid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PluginGuid");
|
||||
|
||||
b.HasIndex("Name", "PluginGuid")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("PluginSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsCollapsed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsSuspended")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ProfileCategories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileContainerEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Icon")
|
||||
.IsRequired()
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("Profile")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("ProfileCategoryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ProfileConfiguration")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProfileCategoryId");
|
||||
|
||||
b.ToTable("ProfileContainers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Surface.DeviceEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<float>("BlueScale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.PrimitiveCollection<string>("Categories")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeviceProvider")
|
||||
.IsRequired()
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<float>("GreenScale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<string>("InputIdentifiers")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("InputMappings")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LayoutParameter")
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LayoutType")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LogicalLayout")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PhysicalLayout")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<float>("RedScale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<float>("Rotation")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<float>("Scale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<float>("X")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<float>("Y")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<int>("ZIndex")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Devices");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Workshop.EntryEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Author")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("AutoUpdate")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Categories")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("Downloads")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("EntryId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("EntryType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("InstalledAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsOfficial")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long?>("LatestReleaseId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Metadata")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("ReleaseId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ReleaseVersion")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Summary")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EntryId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginFeatureEntity", b =>
|
||||
{
|
||||
b.HasOne("Artemis.Storage.Entities.Plugins.PluginEntity", null)
|
||||
.WithMany("Features")
|
||||
.HasForeignKey("PluginEntityId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileContainerEntity", b =>
|
||||
{
|
||||
b.HasOne("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", "ProfileCategory")
|
||||
.WithMany("ProfileConfigurations")
|
||||
.HasForeignKey("ProfileCategoryId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ProfileCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b =>
|
||||
{
|
||||
b.Navigation("Features");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", b =>
|
||||
{
|
||||
b.Navigation("ProfileConfigurations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DevicesClearBrokenJson : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("UPDATE Devices SET InputMappings = \"[]\", InputIdentifiers = \"[]\"");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("UPDATE Devices SET InputMappings = '{\"Capacity\":0}', InputIdentifiers = '{\"Capacity\":0}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Artemis.Storage.Migrations
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.6");
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.General.ReleaseEntity", b =>
|
||||
{
|
||||
@@ -177,7 +177,7 @@ namespace Artemis.Storage.Migrations
|
||||
b.Property<float>("BlueScale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<string>("Categories")
|
||||
b.PrimitiveCollection<string>("Categories")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -189,6 +189,14 @@ namespace Artemis.Storage.Migrations
|
||||
b.Property<float>("GreenScale")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<string>("InputIdentifiers")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("InputMappings")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@@ -311,51 +319,6 @@ namespace Artemis.Storage.Migrations
|
||||
b.Navigation("ProfileCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Surface.DeviceEntity", b =>
|
||||
{
|
||||
b.OwnsOne("System.Collections.Generic.List<Artemis.Storage.Entities.Surface.DeviceInputIdentifierEntity>", "InputIdentifiers", b1 =>
|
||||
{
|
||||
b1.Property<string>("DeviceEntityId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<int>("Capacity")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b1.HasKey("DeviceEntityId");
|
||||
|
||||
b1.ToTable("Devices");
|
||||
|
||||
b1.ToJson("InputIdentifiers");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("DeviceEntityId");
|
||||
});
|
||||
|
||||
b.OwnsOne("System.Collections.Generic.List<Artemis.Storage.Entities.Surface.InputMappingEntity>", "InputMappings", b1 =>
|
||||
{
|
||||
b1.Property<string>("DeviceEntityId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b1.Property<int>("Capacity")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b1.HasKey("DeviceEntityId");
|
||||
|
||||
b1.ToTable("Devices");
|
||||
|
||||
b1.ToJson("InputMappings");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("DeviceEntityId");
|
||||
});
|
||||
|
||||
b.Navigation("InputIdentifiers")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("InputMappings")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b =>
|
||||
{
|
||||
b.Navigation("Features");
|
||||
|
||||
Reference in new issue
Block a user