Add migrations.

This commit is contained in:
Jared Goodwin 2023-06-22 07:44:20 -07:00
parent 1794059822
commit be8073d4d6
11 changed files with 3638 additions and 5 deletions

View File

@ -141,7 +141,8 @@ namespace Remotely.Server.Data
.Property(x => x.MacAddresses)
.HasConversion(
x => JsonSerializer.Serialize(x, jsonOptions),
x => DeserializeStringArray(x, jsonOptions));
x => DeserializeStringArray(x, jsonOptions),
valueComparer: _stringArrayComparer);
builder.Entity<DeviceGroup>()
.HasMany(x => x.Devices);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Remotely.Server.Migrations.PostgreSql
{
/// <inheritdoc />
public partial class Add_Agent_MacAddress : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "MacAddresses",
table: "Devices",
type: "text",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MacAddresses",
table: "Devices");
}
}
}

View File

@ -17,7 +17,7 @@ namespace Remotely.Server.Migrations.PostgreSql
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("ProductVersion", "7.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -451,6 +451,9 @@ namespace Remotely.Server.Migrations.PostgreSql
b.Property<DateTimeOffset>("LastOnline")
.HasColumnType("timestamp with time zone");
b.Property<string>("MacAddresses")
.HasColumnType("text");
b.Property<string>("Notes")
.HasMaxLength(5000)
.HasColumnType("character varying(5000)");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Remotely.Server.Migrations.SqlServer
{
/// <inheritdoc />
public partial class Add_Agent_MacAddress : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "MacAddresses",
table: "Devices",
type: "nvarchar(max)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MacAddresses",
table: "Devices");
}
}
}

View File

@ -17,7 +17,7 @@ namespace Remotely.Server.Migrations.SqlServer
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("ProductVersion", "7.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@ -454,6 +454,9 @@ namespace Remotely.Server.Migrations.SqlServer
b.Property<DateTimeOffset>("LastOnline")
.HasColumnType("datetimeoffset");
b.Property<string>("MacAddresses")
.HasColumnType("nvarchar(max)");
b.Property<string>("Notes")
.HasMaxLength(5000)
.HasColumnType("nvarchar(max)");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Remotely.Server.Migrations.Sqlite
{
/// <inheritdoc />
public partial class Add_Agent_MacAddress : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "MacAddresses",
table: "Devices",
type: "TEXT",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MacAddresses",
table: "Devices");
}
}
}

View File

@ -15,7 +15,7 @@ namespace Remotely.Server.Migrations.Sqlite
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.5");
modelBuilder.HasAnnotation("ProductVersion", "7.0.7");
modelBuilder.Entity("DeviceGroupRemotelyUser", b =>
{
@ -444,6 +444,9 @@ namespace Remotely.Server.Migrations.Sqlite
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("MacAddresses")
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasMaxLength(5000)
.HasColumnType("TEXT");

@ -1 +1 @@
Subproject commit e1188cd0bee2053cdd8c288601c5539572d9534f
Subproject commit 2e6914d88aa2d46aec41f1baff10ab7d15d62c5a