Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,463 changes: 1,463 additions & 0 deletions Common/Migrations/20260316125819_AddWellturnT330.Designer.cs

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions Common/Migrations/20260316125819_AddWellturnT330.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace OpenShock.Common.Migrations
{
/// <inheritdoc />
public partial class AddWellturnT330 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("Npgsql:CollationDefinition:public.ndcoll", "und-u-ks-level2,und-u-ks-level2,icu,False")
.Annotation("Npgsql:Enum:configuration_value_type", "string,bool,int,float,json")
.Annotation("Npgsql:Enum:control_type", "sound,vibrate,shock,stop")
.Annotation("Npgsql:Enum:match_type_enum", "exact,contains")
.Annotation("Npgsql:Enum:ota_update_status", "started,running,finished,error,timeout")
.Annotation("Npgsql:Enum:password_encryption_type", "pbkdf2,bcrypt_enhanced")
.Annotation("Npgsql:Enum:permission_type", "shockers.use,shockers.edit,shockers.pause,devices.edit,devices.auth")
.Annotation("Npgsql:Enum:role_type", "support,staff,admin,system")
.Annotation("Npgsql:Enum:shocker_model_type", "caiXianlin,petTrainer,petrainer998DR,wellturnT330")
.OldAnnotation("Npgsql:CollationDefinition:public.ndcoll", "und-u-ks-level2,und-u-ks-level2,icu,False")
.OldAnnotation("Npgsql:Enum:configuration_value_type", "string,bool,int,float,json")
.OldAnnotation("Npgsql:Enum:control_type", "sound,vibrate,shock,stop")
.OldAnnotation("Npgsql:Enum:match_type_enum", "exact,contains")
.OldAnnotation("Npgsql:Enum:ota_update_status", "started,running,finished,error,timeout")
.OldAnnotation("Npgsql:Enum:password_encryption_type", "pbkdf2,bcrypt_enhanced")
.OldAnnotation("Npgsql:Enum:permission_type", "shockers.use,shockers.edit,shockers.pause,devices.edit,devices.auth")
.OldAnnotation("Npgsql:Enum:role_type", "support,staff,admin,system")
.OldAnnotation("Npgsql:Enum:shocker_model_type", "caiXianlin,petTrainer,petrainer998DR");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("Npgsql:CollationDefinition:public.ndcoll", "und-u-ks-level2,und-u-ks-level2,icu,False")
.Annotation("Npgsql:Enum:configuration_value_type", "string,bool,int,float,json")
.Annotation("Npgsql:Enum:control_type", "sound,vibrate,shock,stop")
.Annotation("Npgsql:Enum:match_type_enum", "exact,contains")
.Annotation("Npgsql:Enum:ota_update_status", "started,running,finished,error,timeout")
.Annotation("Npgsql:Enum:password_encryption_type", "pbkdf2,bcrypt_enhanced")
.Annotation("Npgsql:Enum:permission_type", "shockers.use,shockers.edit,shockers.pause,devices.edit,devices.auth")
.Annotation("Npgsql:Enum:role_type", "support,staff,admin,system")
.Annotation("Npgsql:Enum:shocker_model_type", "caiXianlin,petTrainer,petrainer998DR")
.OldAnnotation("Npgsql:CollationDefinition:public.ndcoll", "und-u-ks-level2,und-u-ks-level2,icu,False")
.OldAnnotation("Npgsql:Enum:configuration_value_type", "string,bool,int,float,json")
.OldAnnotation("Npgsql:Enum:control_type", "sound,vibrate,shock,stop")
.OldAnnotation("Npgsql:Enum:match_type_enum", "exact,contains")
.OldAnnotation("Npgsql:Enum:ota_update_status", "started,running,finished,error,timeout")
.OldAnnotation("Npgsql:Enum:password_encryption_type", "pbkdf2,bcrypt_enhanced")
.OldAnnotation("Npgsql:Enum:permission_type", "shockers.use,shockers.edit,shockers.pause,devices.edit,devices.auth")
.OldAnnotation("Npgsql:Enum:role_type", "support,staff,admin,system")
.OldAnnotation("Npgsql:Enum:shocker_model_type", "caiXianlin,petTrainer,petrainer998DR,wellturnT330");
}
}
}
5 changes: 2 additions & 3 deletions Common/Migrations/OpenShockContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:CollationDefinition:public.ndcoll", "und-u-ks-level2,und-u-ks-level2,icu,False")
.HasAnnotation("ProductVersion", "9.0.8")
.HasAnnotation("ProductVersion", "10.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);

NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "configuration_value_type", new[] { "string", "bool", "int", "float", "json" });
Expand All @@ -31,7 +31,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "password_encryption_type", new[] { "pbkdf2", "bcrypt_enhanced" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "permission_type", new[] { "shockers.use", "shockers.edit", "shockers.pause", "devices.edit", "devices.auth" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "role_type", new[] { "support", "staff", "admin", "system" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "shocker_model_type", new[] { "caiXianlin", "petTrainer", "petrainer998DR" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "shocker_model_type", new[] { "caiXianlin", "petTrainer", "petrainer998DR", "wellturnT330" });
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
Expand Down Expand Up @@ -102,7 +102,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnName("name_change_request_count");

b.Property<string>("PasswordHashType")
.IsRequired()
.HasColumnType("character varying")
.HasColumnName("password_hash_type");

Expand Down
1 change: 1 addition & 0 deletions Common/Models/ShockerModelType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public enum ShockerModelType
[PgName("caiXianlin")] CaiXianlin = 0,
[PgName("petTrainer")] PetTrainer = 1, // Misspelled, should be "petrainer",
[PgName("petrainer998DR")] Petrainer998DR = 2,
[PgName("wellturnT330")] WellturnT330 = 3,
}
2 changes: 1 addition & 1 deletion Common/OpenShockDb/OpenShockContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasPostgresEnum("permission_type",
["shockers.use", "shockers.edit", "shockers.pause", "devices.edit", "devices.auth"])
.HasPostgresEnum("role_type", ["support", "staff", "admin", "system"])
.HasPostgresEnum("shocker_model_type", ["caiXianlin", "petTrainer", "petrainer998DR"])
.HasPostgresEnum("shocker_model_type", ["caiXianlin", "petTrainer", "petrainer998DR", "wellturnT330"])
.HasPostgresEnum("match_type_enum", ["exact", "contains"])
.HasPostgresEnum("configuration_value_type", ["string", "bool", "int", "float", "json"])
.HasCollation("public", "ndcoll", "und-u-ks-level2", "icu", false); // Add case-insensitive, accent-sensitive comparison collation
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
<PackageVersion Include="NRedisStack" Version="1.3.0" />
<PackageVersion Include="OneOf" Version="3.0.271" />
<PackageVersion Include="OpenShock.Serialization.Flatbuffers" Version="2.0.0-preview.5" />
<PackageVersion Include="OpenShock.Serialization.Flatbuffers" Version="2.1.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.12.0-beta.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.1" />
Expand Down
1 change: 1 addition & 0 deletions LiveControlGateway/Mappers/FbsMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static Serialization.Types.ShockerModelType ToFbsModelType(Common.Models.
Common.Models.ShockerModelType.CaiXianlin => Serialization.Types.ShockerModelType.CaiXianlin,
Common.Models.ShockerModelType.PetTrainer => Serialization.Types.ShockerModelType.Petrainer,
Common.Models.ShockerModelType.Petrainer998DR => Serialization.Types.ShockerModelType.Petrainer998DR,
Common.Models.ShockerModelType.WellturnT330 => Serialization.Types.ShockerModelType.WellturnT330,
_ => throw new NotImplementedException(),
};
}
Expand Down
Loading