adds additional index to album table
This commit is contained in:
parent
7e528cd25d
commit
65902b44df
158
PiwigoDirectorySync/Migrations/20230830213947_Adds_serverId_path_index_to_album.Designer.cs
generated
Normal file
158
PiwigoDirectorySync/Migrations/20230830213947_Adds_serverId_path_index_to_album.Designer.cs
generated
Normal file
@ -0,0 +1,158 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using PiwigoDirectorySync.Persistence;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PiwigoDirectorySync.Migrations
|
||||
{
|
||||
[DbContext(typeof(PersistenceContext))]
|
||||
[Migration("20230830213947_Adds_serverId_path_index_to_album")]
|
||||
partial class Adds_serverId_path_index_to_album
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.10");
|
||||
|
||||
modelBuilder.Entity("PiwigoDirectorySync.Persistence.AlbumEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("ParentId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("ServerAlbumId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ServerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.HasIndex("ServerAlbumId");
|
||||
|
||||
b.HasIndex("ServerId", "Path");
|
||||
|
||||
b.ToTable("PiwigoAlbums");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PiwigoDirectorySync.Persistence.ImageEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AlbumId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("DeleteRequired")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("FilePath")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastChange")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Md5Sum")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("ServerImageId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("UploadRequired")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ServerImageId");
|
||||
|
||||
b.HasIndex("AlbumId", "FilePath");
|
||||
|
||||
b.ToTable("PiwigoImages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PiwigoDirectorySync.Persistence.ServerEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("RootDirectory")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Url")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("PiwigoServers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PiwigoDirectorySync.Persistence.AlbumEntity", b =>
|
||||
{
|
||||
b.HasOne("PiwigoDirectorySync.Persistence.AlbumEntity", "Parent")
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.HasOne("PiwigoDirectorySync.Persistence.ServerEntity", "Server")
|
||||
.WithMany()
|
||||
.HasForeignKey("ServerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Parent");
|
||||
|
||||
b.Navigation("Server");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PiwigoDirectorySync.Persistence.ImageEntity", b =>
|
||||
{
|
||||
b.HasOne("PiwigoDirectorySync.Persistence.AlbumEntity", "Album")
|
||||
.WithMany()
|
||||
.HasForeignKey("AlbumId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Album");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PiwigoDirectorySync.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Adds_serverId_path_index_to_album : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PiwigoAlbums_ServerId",
|
||||
table: "PiwigoAlbums");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PiwigoAlbums_ServerId_Path",
|
||||
table: "PiwigoAlbums",
|
||||
columns: new[] { "ServerId", "Path" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PiwigoAlbums_ServerId_Path",
|
||||
table: "PiwigoAlbums");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PiwigoAlbums_ServerId",
|
||||
table: "PiwigoAlbums",
|
||||
column: "ServerId");
|
||||
}
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ namespace PiwigoDirectorySync.Migrations
|
||||
|
||||
b.HasIndex("ServerAlbumId");
|
||||
|
||||
b.HasIndex("ServerId");
|
||||
b.HasIndex("ServerId", "Path");
|
||||
|
||||
b.ToTable("PiwigoAlbums");
|
||||
});
|
||||
|
@ -6,6 +6,7 @@ namespace PiwigoDirectorySync.Persistence;
|
||||
|
||||
[Index(nameof(ParentId))]
|
||||
[Index(nameof(ServerAlbumId))]
|
||||
[Index(nameof(ServerId), nameof(Path))]
|
||||
public class AlbumEntity
|
||||
{
|
||||
[Key]
|
||||
|
Loading…
Reference in New Issue
Block a user