386 lines
12 KiB
C#
386 lines
12 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using WebApiTest.Context;
|
|
|
|
#nullable disable
|
|
|
|
namespace WebApiTest.Migrations
|
|
{
|
|
[DbContext(typeof(TestDbContext))]
|
|
[Migration("20240919224557_Initial")]
|
|
partial class Initial
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.8")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("AlbumAsset", b =>
|
|
{
|
|
b.Property<Guid>("AlbumsId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<Guid>("AssetsId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.HasKey("AlbumsId", "AssetsId");
|
|
|
|
b.HasIndex("AssetsId");
|
|
|
|
b.ToTable("AlbumAsset");
|
|
});
|
|
|
|
modelBuilder.Entity("AssetTag", b =>
|
|
{
|
|
b.Property<Guid>("AssetsId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<Guid>("TagsId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.HasKey("AssetsId", "TagsId");
|
|
|
|
b.HasIndex("TagsId");
|
|
|
|
b.ToTable("AssetTag");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Album", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("AssetIds")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime?>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<Guid>("OwnerId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerId");
|
|
|
|
b.ToTable("Albums");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Asset", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("AlbumsId")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("FacesId")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsPubiclyShared")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("OriginalFilename")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("OriginalPath")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<Guid>("OwnerUserId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("PreviewPath")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("TagsId")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ThumbnailPath")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerUserId");
|
|
|
|
b.ToTable("Assets");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Face", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<Guid>("AssetId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<int>("BoundingBoxX1")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("BoundingBoxX2")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("BoundingBoxY1")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("BoundingBoxY2")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("ImageHeight")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("ImageWidth")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("PersonId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssetId");
|
|
|
|
b.HasIndex("PersonId");
|
|
|
|
b.ToTable("Faces");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Person", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("FacesId")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("People");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Tag", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<string>("AssetIds")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<Guid?>("ParentId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentId");
|
|
|
|
b.ToTable("Tags");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<int>("AccessLevel")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid?>("AssetId")
|
|
.HasColumnType("char(36)");
|
|
|
|
b.Property<DateTime?>("BannedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("VARCHAR(128)");
|
|
|
|
b.Property<DateTime?>("LastLogin")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasColumnType("VARCHAR(255)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasColumnType("VARCHAR(64)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssetId");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("AlbumAsset", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.Album", null)
|
|
.WithMany()
|
|
.HasForeignKey("AlbumsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("WebApiTest.Models.Asset", null)
|
|
.WithMany()
|
|
.HasForeignKey("AssetsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("AssetTag", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.Asset", null)
|
|
.WithMany()
|
|
.HasForeignKey("AssetsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("WebApiTest.Models.Tag", null)
|
|
.WithMany()
|
|
.HasForeignKey("TagsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Album", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.User", "Owner")
|
|
.WithMany()
|
|
.HasForeignKey("OwnerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Owner");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Asset", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.User", "OwnerUser")
|
|
.WithMany()
|
|
.HasForeignKey("OwnerUserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("OwnerUser");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Face", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.Asset", "Asset")
|
|
.WithMany("Faces")
|
|
.HasForeignKey("AssetId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("WebApiTest.Models.Person", "Person")
|
|
.WithMany("Faces")
|
|
.HasForeignKey("PersonId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Asset");
|
|
|
|
b.Navigation("Person");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Tag", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.Tag", "Parent")
|
|
.WithMany()
|
|
.HasForeignKey("ParentId");
|
|
|
|
b.Navigation("Parent");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.User", b =>
|
|
{
|
|
b.HasOne("WebApiTest.Models.Asset", null)
|
|
.WithMany("SharedWith")
|
|
.HasForeignKey("AssetId");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Asset", b =>
|
|
{
|
|
b.Navigation("Faces");
|
|
|
|
b.Navigation("SharedWith");
|
|
});
|
|
|
|
modelBuilder.Entity("WebApiTest.Models.Person", b =>
|
|
{
|
|
b.Navigation("Faces");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|