//
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using back.persistance.data;
#nullable disable
namespace back.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20250824120656_InitialSetup")]
partial class InitialSetup
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
modelBuilder.Entity("EventTag", b =>
{
b.Property("EventId")
.HasColumnType("TEXT");
b.Property("TagId")
.HasColumnType("TEXT");
b.HasKey("EventId", "TagId");
b.HasIndex("TagId");
b.ToTable("EventTags", (string)null);
});
modelBuilder.Entity("GalleryPhoto", b =>
{
b.Property("GalleryId")
.HasColumnType("TEXT");
b.Property("PhotoId")
.HasColumnType("TEXT");
b.HasKey("GalleryId", "PhotoId");
b.HasIndex("PhotoId");
b.ToTable("GalleryPhotos", (string)null);
});
modelBuilder.Entity("GalleryTag", b =>
{
b.Property("GalleryId")
.HasColumnType("TEXT");
b.Property("TagId")
.HasColumnType("TEXT");
b.HasKey("GalleryId", "TagId");
b.HasIndex("TagId");
b.ToTable("GalleryTags", (string)null);
});
modelBuilder.Entity("GalleryUserViewer", b =>
{
b.Property("GalleryId")
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("GalleryId", "UserId");
b.HasIndex("UserId");
b.ToTable("GalleryUserViewers", (string)null);
});
modelBuilder.Entity("PhotoPerson", b =>
{
b.Property("PhotoId")
.HasColumnType("TEXT");
b.Property("PersonId")
.HasColumnType("TEXT");
b.HasKey("PhotoId", "PersonId");
b.HasIndex("PersonId");
b.ToTable("PhotoPersons", (string)null);
});
modelBuilder.Entity("PhotoTag", b =>
{
b.Property("PhotoId")
.HasColumnType("TEXT");
b.Property("TagId")
.HasColumnType("TEXT");
b.HasKey("PhotoId", "TagId");
b.HasIndex("TagId");
b.ToTable("PhotoTags", (string)null);
});
modelBuilder.Entity("PhotoUserBuyer", b =>
{
b.Property("PhotoId")
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("PhotoId", "UserId");
b.HasIndex("UserId");
b.ToTable("PhotoUserBuyers", (string)null);
});
modelBuilder.Entity("RolePermission", b =>
{
b.Property("RoleId")
.HasColumnType("TEXT");
b.Property("PermissionId")
.HasColumnType("TEXT");
b.HasKey("RoleId", "PermissionId");
b.HasIndex("PermissionId");
b.ToTable("RolePermissions", (string)null);
});
modelBuilder.Entity("UserRole", b =>
{
b.Property("UserId")
.HasColumnType("TEXT");
b.Property("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("back.DataModels.EfmigrationsLock", b =>
{
b.Property("Id")
.HasColumnType("INTEGER");
b.Property("Timestamp")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("__EFMigrationsLock", (string)null);
});
modelBuilder.Entity("back.DataModels.Event", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.IsRequired()
.HasColumnType("TEXT");
b.Property("CreatedBy")
.HasColumnType("TEXT");
b.Property("Date")
.HasColumnType("TEXT");
b.Property("DeletedAt")
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("Location")
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UpdatedBy")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Events");
});
modelBuilder.Entity("back.DataModels.Gallery", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("CreatedBy")
.IsRequired()
.HasColumnType("TEXT");
b.Property("DeletedAt")
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("EventId")
.HasColumnType("TEXT");
b.Property("IsArchived")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(0);
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("IsFavorite")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(0);
b.Property("IsPublic")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1);
b.Property("Title")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("EventId");
b.ToTable("Galleries");
});
modelBuilder.Entity("back.DataModels.Permission", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Permissions");
});
modelBuilder.Entity("back.DataModels.Person", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Avatar")
.HasColumnType("TEXT");
b.Property("Bio")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.IsRequired()
.HasColumnType("TEXT");
b.Property("DeletedAt")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("ProfilePicture")
.HasColumnType("TEXT");
b.Property("SocialMediaId")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SocialMediaId");
b.ToTable("Persons");
});
modelBuilder.Entity("back.DataModels.Photo", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("CreatedBy")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("EventId")
.HasColumnType("TEXT");
b.Property("Extension")
.HasColumnType("TEXT");
b.Property("HighResUrl")
.HasColumnType("TEXT");
b.Property("IsArchived")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(0);
b.Property("IsFavorite")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(0);
b.Property("IsPublic")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1);
b.Property("LowResUrl")
.HasColumnType("TEXT");
b.Property("MidResUrl")
.HasColumnType("TEXT");
b.Property("RankingId")
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("UpdatedBy")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("EventId");
b.ToTable("Photos");
});
modelBuilder.Entity("back.DataModels.Ranking", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("DownVotes")
.HasColumnType("INTEGER");
b.Property("TotalVotes")
.HasColumnType("INTEGER");
b.Property("UpVotes")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Rankings");
});
modelBuilder.Entity("back.DataModels.Role", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("BaseRoleModelId")
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("BaseRoleModelId");
b.ToTable("Roles");
});
modelBuilder.Entity("back.DataModels.SocialMedia", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("BlueSky")
.HasColumnType("TEXT");
b.Property("Discord")
.HasColumnType("TEXT");
b.Property("Facebook")
.HasColumnType("TEXT");
b.Property("Instagram")
.HasColumnType("TEXT");
b.Property("Linkedin")
.HasColumnType("TEXT");
b.Property("Other")
.HasColumnType("TEXT");
b.Property("Pinterest")
.HasColumnType("TEXT");
b.Property("Reddit")
.HasColumnType("TEXT");
b.Property("Tiktok")
.HasColumnType("TEXT");
b.Property("Twitter")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("SocialMedia");
});
modelBuilder.Entity("back.DataModels.Tag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(25)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex(new[] { "Name" }, "IX_Tags_Name")
.IsUnique();
b.ToTable("Tags");
});
modelBuilder.Entity("back.DataModels.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Email")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Password")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Salt")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("EventTag", b =>
{
b.HasOne("back.DataModels.Event", null)
.WithMany()
.HasForeignKey("EventId")
.IsRequired();
b.HasOne("back.DataModels.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.IsRequired();
});
modelBuilder.Entity("GalleryPhoto", b =>
{
b.HasOne("back.DataModels.Gallery", null)
.WithMany()
.HasForeignKey("GalleryId")
.IsRequired();
b.HasOne("back.DataModels.Photo", null)
.WithMany()
.HasForeignKey("PhotoId")
.IsRequired();
});
modelBuilder.Entity("GalleryTag", b =>
{
b.HasOne("back.DataModels.Gallery", null)
.WithMany()
.HasForeignKey("GalleryId")
.IsRequired();
b.HasOne("back.DataModels.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.IsRequired();
});
modelBuilder.Entity("GalleryUserViewer", b =>
{
b.HasOne("back.DataModels.Gallery", null)
.WithMany()
.HasForeignKey("GalleryId")
.IsRequired();
b.HasOne("back.DataModels.User", null)
.WithMany()
.HasForeignKey("UserId")
.IsRequired();
});
modelBuilder.Entity("PhotoPerson", b =>
{
b.HasOne("back.DataModels.Person", null)
.WithMany()
.HasForeignKey("PersonId")
.IsRequired();
b.HasOne("back.DataModels.Photo", null)
.WithMany()
.HasForeignKey("PhotoId")
.IsRequired();
});
modelBuilder.Entity("PhotoTag", b =>
{
b.HasOne("back.DataModels.Photo", null)
.WithMany()
.HasForeignKey("PhotoId")
.IsRequired();
b.HasOne("back.DataModels.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.IsRequired();
});
modelBuilder.Entity("PhotoUserBuyer", b =>
{
b.HasOne("back.DataModels.Photo", null)
.WithMany()
.HasForeignKey("PhotoId")
.IsRequired();
b.HasOne("back.DataModels.User", null)
.WithMany()
.HasForeignKey("UserId")
.IsRequired();
});
modelBuilder.Entity("RolePermission", b =>
{
b.HasOne("back.DataModels.Permission", null)
.WithMany()
.HasForeignKey("PermissionId")
.IsRequired();
b.HasOne("back.DataModels.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.IsRequired();
});
modelBuilder.Entity("UserRole", b =>
{
b.HasOne("back.DataModels.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.IsRequired();
b.HasOne("back.DataModels.User", null)
.WithMany()
.HasForeignKey("UserId")
.IsRequired();
});
modelBuilder.Entity("back.DataModels.Gallery", b =>
{
b.HasOne("back.DataModels.User", "CreatedByNavigation")
.WithMany("Galleries")
.HasForeignKey("CreatedBy")
.IsRequired();
b.HasOne("back.DataModels.Event", "Event")
.WithMany("Galleries")
.HasForeignKey("EventId");
b.Navigation("CreatedByNavigation");
b.Navigation("Event");
});
modelBuilder.Entity("back.DataModels.Person", b =>
{
b.HasOne("back.DataModels.SocialMedia", "SocialMedia")
.WithMany("People")
.HasForeignKey("SocialMediaId");
b.Navigation("SocialMedia");
});
modelBuilder.Entity("back.DataModels.Photo", b =>
{
b.HasOne("back.DataModels.Person", "CreatedByNavigation")
.WithMany("Photos")
.HasForeignKey("CreatedBy")
.IsRequired();
b.HasOne("back.DataModels.Event", "Event")
.WithMany("Photos")
.HasForeignKey("EventId");
b.Navigation("CreatedByNavigation");
b.Navigation("Event");
});
modelBuilder.Entity("back.DataModels.Role", b =>
{
b.HasOne("back.DataModels.Role", "BaseRoleModel")
.WithMany("InverseBaseRoleModel")
.HasForeignKey("BaseRoleModelId");
b.Navigation("BaseRoleModel");
});
modelBuilder.Entity("back.DataModels.User", b =>
{
b.HasOne("back.DataModels.Person", "IdNavigation")
.WithOne("User")
.HasForeignKey("back.DataModels.User", "Id")
.IsRequired();
b.Navigation("IdNavigation");
});
modelBuilder.Entity("back.DataModels.Event", b =>
{
b.Navigation("Galleries");
b.Navigation("Photos");
});
modelBuilder.Entity("back.DataModels.Person", b =>
{
b.Navigation("Photos");
b.Navigation("User");
});
modelBuilder.Entity("back.DataModels.Role", b =>
{
b.Navigation("InverseBaseRoleModel");
});
modelBuilder.Entity("back.DataModels.SocialMedia", b =>
{
b.Navigation("People");
});
modelBuilder.Entity("back.DataModels.User", b =>
{
b.Navigation("Galleries");
});
#pragma warning restore 612, 618
}
}
}