Skip to content

Commit

Permalink
Merge pull request #1093 from pkuehnel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pkuehnel authored Jan 27, 2024
2 parents 917d38b + ee9f3d5 commit f738d81
Show file tree
Hide file tree
Showing 24 changed files with 1,379 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<TscConfiguration>()
.HasIndex(c => c.Key)
.IsUnique();

modelBuilder.Entity<Car>()
.HasIndex(c => c.TeslaMateCarId)
.IsUnique();
}

#pragma warning disable CS8618
Expand Down

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TeslaSolarCharger.Model.Migrations
{
/// <inheritdoc />
public partial class MakeCarTeslaMateCarIdUnique : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_Cars_TeslaMateCarId",
table: "Cars",
column: "TeslaMateCarId",
unique: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Cars_TeslaMateCarId",
table: "Cars");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasKey("Id");

b.HasIndex("TeslaMateCarId")
.IsUnique();

b.ToTable("Cars");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

public interface ITeslaMateMqttService
{
Task ConnectMqttClient();
bool IsMqttClientConnected { get; }
Task ConnectClientIfNotConnected();
Task DisconnectClient(string reason);
Expand Down
Loading

0 comments on commit f738d81

Please sign in to comment.