transactions
This commit is contained in:
752
back/persistance/data/migrations/20250824120656_InitialSetup.Designer.cs
generated
Normal file
752
back/persistance/data/migrations/20250824120656_InitialSetup.Designer.cs
generated
Normal file
@@ -0,0 +1,752 @@
|
||||
// <auto-generated />
|
||||
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
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("EventTag", b =>
|
||||
{
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("EventId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("EventTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryPhoto", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "PhotoId");
|
||||
|
||||
b.HasIndex("PhotoId");
|
||||
|
||||
b.ToTable("GalleryPhotos", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryTag", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("GalleryTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryUserViewer", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "UserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("GalleryUserViewers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoPerson", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PersonId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "PersonId");
|
||||
|
||||
b.HasIndex("PersonId");
|
||||
|
||||
b.ToTable("PhotoPersons", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoTag", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("PhotoTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoUserBuyer", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "UserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("PhotoUserBuyers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RolePermission", b =>
|
||||
{
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PermissionId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("RoleId", "PermissionId");
|
||||
|
||||
b.HasIndex("PermissionId");
|
||||
|
||||
b.ToTable("RolePermissions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("UserRole", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.EfmigrationsLock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Timestamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("__EFMigrationsLock", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Event", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Location")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Gallery", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("IsArchived")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("IsFavorite")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsPublic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1);
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.ToTable("Galleries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Permission", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Permissions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Person", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Avatar")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Bio")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ProfilePicture")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SocialMediaId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SocialMediaId");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Photo", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Extension")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("HighResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("IsArchived")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsFavorite")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsPublic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1);
|
||||
|
||||
b.Property<string>("LowResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("MidResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("RankingId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Ranking", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("DownVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TotalVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("UpVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Rankings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Role", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BaseRoleModelId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BaseRoleModelId");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.SocialMedia", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BlueSky")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Discord")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Facebook")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Instagram")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Linkedin")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Other")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Pinterest")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Reddit")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Tiktok")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Twitter")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("SocialMedia");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Tag", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("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
|
||||
}
|
||||
}
|
||||
}
|
583
back/persistance/data/migrations/20250824120656_InitialSetup.cs
Normal file
583
back/persistance/data/migrations/20250824120656_InitialSetup.cs
Normal file
@@ -0,0 +1,583 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace back.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialSetup : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "__EFMigrationsLock",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Timestamp = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK___EFMigrationsLock", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Events",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
Date = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Location = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: false),
|
||||
UpdatedAt = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "TEXT", nullable: true),
|
||||
IsDeleted = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
DeletedAt = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Events", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Permissions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Permissions", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Rankings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
TotalVotes = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
UpVotes = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
DownVotes = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Rankings", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Roles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 250, nullable: true),
|
||||
BaseRoleModelId = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Roles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Roles_Roles_BaseRoleModelId",
|
||||
column: x => x.BaseRoleModelId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SocialMedia",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Facebook = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Instagram = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Twitter = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BlueSky = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Tiktok = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Linkedin = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Pinterest = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Discord = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Reddit = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Other = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SocialMedia", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tags",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 25, nullable: false),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tags", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RolePermissions",
|
||||
columns: table => new
|
||||
{
|
||||
RoleId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
PermissionId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RolePermissions", x => new { x.RoleId, x.PermissionId });
|
||||
table.ForeignKey(
|
||||
name: "FK_RolePermissions_Permissions_PermissionId",
|
||||
column: x => x.PermissionId,
|
||||
principalTable: "Permissions",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_RolePermissions_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Persons",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
ProfilePicture = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Avatar = table.Column<string>(type: "TEXT", nullable: true),
|
||||
SocialMediaId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Bio = table.Column<string>(type: "TEXT", maxLength: 250, nullable: true),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: false),
|
||||
UpdatedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
IsDeleted = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
DeletedAt = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Persons", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Persons_SocialMedia_SocialMediaId",
|
||||
column: x => x.SocialMediaId,
|
||||
principalTable: "SocialMedia",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EventTags",
|
||||
columns: table => new
|
||||
{
|
||||
EventId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
TagId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EventTags", x => new { x.EventId, x.TagId });
|
||||
table.ForeignKey(
|
||||
name: "FK_EventTags_Events_EventId",
|
||||
column: x => x.EventId,
|
||||
principalTable: "Events",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_EventTags_Tags_TagId",
|
||||
column: x => x.TagId,
|
||||
principalTable: "Tags",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Photos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
Extension = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LowResUrl = table.Column<string>(type: "TEXT", nullable: true),
|
||||
MidResUrl = table.Column<string>(type: "TEXT", nullable: true),
|
||||
HighResUrl = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UpdatedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "TEXT", nullable: false),
|
||||
UpdatedBy = table.Column<string>(type: "TEXT", nullable: true),
|
||||
EventId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
RankingId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
IsFavorite = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 0),
|
||||
IsPublic = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 1),
|
||||
IsArchived = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 0)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Photos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Photos_Events_EventId",
|
||||
column: x => x.EventId,
|
||||
principalTable: "Events",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Photos_Persons_CreatedBy",
|
||||
column: x => x.CreatedBy,
|
||||
principalTable: "Persons",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Email = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Password = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Salt = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Persons_Id",
|
||||
column: x => x.Id,
|
||||
principalTable: "Persons",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PhotoPersons",
|
||||
columns: table => new
|
||||
{
|
||||
PhotoId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
PersonId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PhotoPersons", x => new { x.PhotoId, x.PersonId });
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoPersons_Persons_PersonId",
|
||||
column: x => x.PersonId,
|
||||
principalTable: "Persons",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoPersons_Photos_PhotoId",
|
||||
column: x => x.PhotoId,
|
||||
principalTable: "Photos",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PhotoTags",
|
||||
columns: table => new
|
||||
{
|
||||
PhotoId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
TagId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PhotoTags", x => new { x.PhotoId, x.TagId });
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoTags_Photos_PhotoId",
|
||||
column: x => x.PhotoId,
|
||||
principalTable: "Photos",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoTags_Tags_TagId",
|
||||
column: x => x.TagId,
|
||||
principalTable: "Tags",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Galleries",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
CreatedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UpdatedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "TEXT", nullable: false),
|
||||
IsPublic = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 1),
|
||||
IsArchived = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 0),
|
||||
IsFavorite = table.Column<int>(type: "INTEGER", nullable: true, defaultValue: 0),
|
||||
IsDeleted = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
DeletedAt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
EventId = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Galleries", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Galleries_Events_EventId",
|
||||
column: x => x.EventId,
|
||||
principalTable: "Events",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Galleries_Users_CreatedBy",
|
||||
column: x => x.CreatedBy,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PhotoUserBuyers",
|
||||
columns: table => new
|
||||
{
|
||||
PhotoId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
UserId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PhotoUserBuyers", x => new { x.PhotoId, x.UserId });
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoUserBuyers_Photos_PhotoId",
|
||||
column: x => x.PhotoId,
|
||||
principalTable: "Photos",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PhotoUserBuyers_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
RoleId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GalleryPhotos",
|
||||
columns: table => new
|
||||
{
|
||||
GalleryId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
PhotoId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GalleryPhotos", x => new { x.GalleryId, x.PhotoId });
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryPhotos_Galleries_GalleryId",
|
||||
column: x => x.GalleryId,
|
||||
principalTable: "Galleries",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryPhotos_Photos_PhotoId",
|
||||
column: x => x.PhotoId,
|
||||
principalTable: "Photos",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GalleryTags",
|
||||
columns: table => new
|
||||
{
|
||||
GalleryId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
TagId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GalleryTags", x => new { x.GalleryId, x.TagId });
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryTags_Galleries_GalleryId",
|
||||
column: x => x.GalleryId,
|
||||
principalTable: "Galleries",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryTags_Tags_TagId",
|
||||
column: x => x.TagId,
|
||||
principalTable: "Tags",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GalleryUserViewers",
|
||||
columns: table => new
|
||||
{
|
||||
GalleryId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
UserId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GalleryUserViewers", x => new { x.GalleryId, x.UserId });
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryUserViewers_Galleries_GalleryId",
|
||||
column: x => x.GalleryId,
|
||||
principalTable: "Galleries",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GalleryUserViewers_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EventTags_TagId",
|
||||
table: "EventTags",
|
||||
column: "TagId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Galleries_CreatedBy",
|
||||
table: "Galleries",
|
||||
column: "CreatedBy");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Galleries_EventId",
|
||||
table: "Galleries",
|
||||
column: "EventId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GalleryPhotos_PhotoId",
|
||||
table: "GalleryPhotos",
|
||||
column: "PhotoId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GalleryTags_TagId",
|
||||
table: "GalleryTags",
|
||||
column: "TagId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GalleryUserViewers_UserId",
|
||||
table: "GalleryUserViewers",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Persons_SocialMediaId",
|
||||
table: "Persons",
|
||||
column: "SocialMediaId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PhotoPersons_PersonId",
|
||||
table: "PhotoPersons",
|
||||
column: "PersonId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Photos_CreatedBy",
|
||||
table: "Photos",
|
||||
column: "CreatedBy");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Photos_EventId",
|
||||
table: "Photos",
|
||||
column: "EventId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PhotoTags_TagId",
|
||||
table: "PhotoTags",
|
||||
column: "TagId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PhotoUserBuyers_UserId",
|
||||
table: "PhotoUserBuyers",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RolePermissions_PermissionId",
|
||||
table: "RolePermissions",
|
||||
column: "PermissionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Roles_BaseRoleModelId",
|
||||
table: "Roles",
|
||||
column: "BaseRoleModelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tags_Name",
|
||||
table: "Tags",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserRoles_RoleId",
|
||||
table: "UserRoles",
|
||||
column: "RoleId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "__EFMigrationsLock");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EventTags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GalleryPhotos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GalleryTags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GalleryUserViewers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PhotoPersons");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PhotoTags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PhotoUserBuyers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Rankings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RolePermissions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Galleries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Photos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Permissions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Roles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Events");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Persons");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SocialMedia");
|
||||
}
|
||||
}
|
||||
}
|
749
back/persistance/data/migrations/DataContextModelSnapshot.cs
Normal file
749
back/persistance/data/migrations/DataContextModelSnapshot.cs
Normal file
@@ -0,0 +1,749 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using back.persistance.data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace back.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
partial class DataContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("EventTag", b =>
|
||||
{
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("EventId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("EventTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryPhoto", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "PhotoId");
|
||||
|
||||
b.HasIndex("PhotoId");
|
||||
|
||||
b.ToTable("GalleryPhotos", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryTag", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("GalleryTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GalleryUserViewer", b =>
|
||||
{
|
||||
b.Property<string>("GalleryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GalleryId", "UserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("GalleryUserViewers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoPerson", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PersonId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "PersonId");
|
||||
|
||||
b.HasIndex("PersonId");
|
||||
|
||||
b.ToTable("PhotoPersons", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoTag", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "TagId");
|
||||
|
||||
b.HasIndex("TagId");
|
||||
|
||||
b.ToTable("PhotoTags", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PhotoUserBuyer", b =>
|
||||
{
|
||||
b.Property<string>("PhotoId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PhotoId", "UserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("PhotoUserBuyers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RolePermission", b =>
|
||||
{
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("PermissionId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("RoleId", "PermissionId");
|
||||
|
||||
b.HasIndex("PermissionId");
|
||||
|
||||
b.ToTable("RolePermissions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("UserRole", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.EfmigrationsLock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Timestamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("__EFMigrationsLock", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Event", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Location")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Gallery", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("IsArchived")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("IsFavorite")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsPublic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1);
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.ToTable("Galleries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Permission", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Permissions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Person", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Avatar")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Bio")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DeletedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("IsDeleted")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ProfilePicture")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SocialMediaId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SocialMediaId");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Photo", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EventId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Extension")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("HighResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("IsArchived")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsFavorite")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0);
|
||||
|
||||
b.Property<int?>("IsPublic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1);
|
||||
|
||||
b.Property<string>("LowResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("MidResUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("RankingId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("EventId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Ranking", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("DownVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TotalVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("UpVotes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Rankings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Role", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BaseRoleModelId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BaseRoleModelId");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.SocialMedia", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BlueSky")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Discord")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Facebook")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Instagram")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Linkedin")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Other")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Pinterest")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Reddit")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Tiktok")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Twitter")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("SocialMedia");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("back.DataModels.Tag", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CreatedAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("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
|
||||
}
|
||||
}
|
||||
}
|
200
back/persistance/data/migrations/sqlite/tables.sql
Normal file
200
back/persistance/data/migrations/sqlite/tables.sql
Normal file
@@ -0,0 +1,200 @@
|
||||
-- Tabla de redes sociales (SocialMedia) y relación uno a uno con Person
|
||||
CREATE TABLE IF NOT EXISTS SocialMedia (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Facebook TEXT,
|
||||
Instagram TEXT,
|
||||
Twitter TEXT,
|
||||
BlueSky TEXT,
|
||||
Tiktok TEXT,
|
||||
Linkedin TEXT,
|
||||
Pinterest TEXT,
|
||||
Discord TEXT,
|
||||
Reddit TEXT,
|
||||
Other TEXT
|
||||
);
|
||||
|
||||
-- Person: cada persona tiene un grupo de redes sociales (uno a uno, fk opcional)
|
||||
CREATE TABLE IF NOT EXISTS Persons (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Name TEXT NOT NULL,
|
||||
ProfilePicture TEXT,
|
||||
Avatar TEXT,
|
||||
SocialMediaId TEXT,
|
||||
Bio TEXT,
|
||||
CreatedAt TEXT NOT NULL,
|
||||
UpdatedAt TEXT,
|
||||
FOREIGN KEY (SocialMediaId) REFERENCES SocialMedia(Id)
|
||||
);
|
||||
|
||||
-- User: es una persona (herencia por clave primaria compartida)
|
||||
CREATE TABLE IF NOT EXISTS Users (
|
||||
Id TEXT PRIMARY KEY, -- MISMA clave y valor que Persons.Id
|
||||
Email TEXT NOT NULL,
|
||||
Password TEXT NOT NULL,
|
||||
Salt TEXT NOT NULL,
|
||||
FOREIGN KEY (Id) REFERENCES Persons(Id)
|
||||
);
|
||||
|
||||
-- Un usuario puede ver muchas galerías (muchos-a-muchos: Galleries <-> Users)
|
||||
CREATE TABLE IF NOT EXISTS GalleryUserViewers (
|
||||
GalleryId TEXT NOT NULL,
|
||||
UserId TEXT NOT NULL,
|
||||
PRIMARY KEY (GalleryId, UserId),
|
||||
FOREIGN KEY (GalleryId) REFERENCES Galleries(Id),
|
||||
FOREIGN KEY (UserId) REFERENCES Users(Id)
|
||||
);
|
||||
|
||||
-- Un usuario ha creado muchas galerías (uno a muchos)
|
||||
-- Una galería solo puede ser creada por un usuario
|
||||
CREATE TABLE IF NOT EXISTS Galleries (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Title TEXT,
|
||||
Description TEXT,
|
||||
CreatedAt TEXT,
|
||||
UpdatedAt TEXT,
|
||||
CreatedBy TEXT NOT NULL, -- FK a Users
|
||||
IsPublic INTEGER DEFAULT 1,
|
||||
IsArchived INTEGER DEFAULT 0,
|
||||
IsFavorite INTEGER DEFAULT 0,
|
||||
EventId TEXT, -- FK opcional a Events (una galería puede asociarse a un evento)
|
||||
FOREIGN KEY (CreatedBy) REFERENCES Users(Id),
|
||||
FOREIGN KEY (EventId) REFERENCES Events(Id)
|
||||
);
|
||||
|
||||
-- Galería-Photo: una galería contiene muchas imagenes, una imagen puede estar en muchas galerías (muchos-a-muchos)
|
||||
CREATE TABLE IF NOT EXISTS GalleryPhotos (
|
||||
GalleryId TEXT NOT NULL,
|
||||
PhotoId TEXT NOT NULL,
|
||||
PRIMARY KEY (GalleryId, PhotoId),
|
||||
FOREIGN KEY (GalleryId) REFERENCES Galleries(Id),
|
||||
FOREIGN KEY (PhotoId) REFERENCES Photos(Id)
|
||||
);
|
||||
|
||||
-- Tabla de eventos
|
||||
CREATE TABLE IF NOT EXISTS Events (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Title TEXT NOT NULL,
|
||||
Description TEXT,
|
||||
Date TEXT,
|
||||
Location TEXT,
|
||||
CreatedAt TEXT NOT NULL,
|
||||
UpdatedAt TEXT NOT NULL,
|
||||
CreatedBy TEXT,
|
||||
UpdatedBy TEXT,
|
||||
IsDeleted INTEGER NOT NULL DEFAULT 0,
|
||||
DeletedAt TEXT
|
||||
);
|
||||
|
||||
-- Tabla de fotos
|
||||
CREATE TABLE IF NOT EXISTS Photos (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Title TEXT NOT NULL,
|
||||
Description TEXT,
|
||||
Extension TEXT,
|
||||
LowResUrl TEXT,
|
||||
MidResUrl TEXT,
|
||||
HighResUrl TEXT,
|
||||
CreatedAt TEXT,
|
||||
UpdatedAt TEXT,
|
||||
CreatedBy TEXT NOT NULL, -- Persona que subió la foto: FK a Persons
|
||||
UpdatedBy TEXT,
|
||||
EventId TEXT, -- Una photo solo puede tener un evento asociado (FK)
|
||||
RankingId TEXT,
|
||||
IsFavorite INTEGER DEFAULT 0,
|
||||
IsPublic INTEGER DEFAULT 1,
|
||||
IsArchived INTEGER DEFAULT 0,
|
||||
FOREIGN KEY (CreatedBy) REFERENCES Persons(Id),
|
||||
FOREIGN KEY (EventId) REFERENCES Events(Id)
|
||||
);
|
||||
|
||||
-- Una persona puede salir en muchas fotos, y una foto puede tener muchas personas (muchos-a-muchos)
|
||||
CREATE TABLE IF NOT EXISTS PhotoPersons (
|
||||
PhotoId TEXT NOT NULL,
|
||||
PersonId TEXT NOT NULL,
|
||||
PRIMARY KEY (PhotoId, PersonId),
|
||||
FOREIGN KEY (PhotoId) REFERENCES Photos(Id),
|
||||
FOREIGN KEY (PersonId) REFERENCES Persons(Id)
|
||||
);
|
||||
|
||||
-- Un usuario puede comprar muchas fotos para verlas, y una foto puede haber sido comprada por muchos usuarios
|
||||
-- (solo necesario si IsPublic = 0)
|
||||
CREATE TABLE IF NOT EXISTS PhotoUserBuyers (
|
||||
PhotoId TEXT NOT NULL,
|
||||
UserId TEXT NOT NULL,
|
||||
PRIMARY KEY (PhotoId, UserId),
|
||||
FOREIGN KEY (PhotoId) REFERENCES Photos(Id),
|
||||
FOREIGN KEY (UserId) REFERENCES Users(Id)
|
||||
);
|
||||
|
||||
-- Tabla de tags (únicos)
|
||||
CREATE TABLE IF NOT EXISTS Tags (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Name TEXT NOT NULL UNIQUE,
|
||||
CreatedAt TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- Una foto puede tener muchos tags (muchos-a-muchos)
|
||||
CREATE TABLE IF NOT EXISTS PhotoTags (
|
||||
PhotoId TEXT NOT NULL,
|
||||
TagId TEXT NOT NULL,
|
||||
PRIMARY KEY (PhotoId, TagId),
|
||||
FOREIGN KEY (PhotoId) REFERENCES Photos(Id),
|
||||
FOREIGN KEY (TagId) REFERENCES Tags(Id)
|
||||
);
|
||||
|
||||
-- Un evento puede tener muchos tags (muchos-a-muchos)
|
||||
CREATE TABLE IF NOT EXISTS EventTags (
|
||||
EventId TEXT NOT NULL,
|
||||
TagId TEXT NOT NULL,
|
||||
PRIMARY KEY (EventId, TagId),
|
||||
FOREIGN KEY (EventId) REFERENCES Events(Id),
|
||||
FOREIGN KEY (TagId) REFERENCES Tags(Id)
|
||||
);
|
||||
|
||||
-- Una galería puede tener muchos tags (muchos-a-muchos)
|
||||
CREATE TABLE IF NOT EXISTS GalleryTags (
|
||||
GalleryId TEXT NOT NULL,
|
||||
TagId TEXT NOT NULL,
|
||||
PRIMARY KEY (GalleryId, TagId),
|
||||
FOREIGN KEY (GalleryId) REFERENCES Galleries(Id),
|
||||
FOREIGN KEY (TagId) REFERENCES Tags(Id)
|
||||
);
|
||||
|
||||
-- Rankings (por si corresponde)
|
||||
CREATE TABLE IF NOT EXISTS Rankings (
|
||||
Id TEXT PRIMARY KEY,
|
||||
TotalVotes INTEGER NOT NULL,
|
||||
UpVotes INTEGER NOT NULL,
|
||||
DownVotes INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- Permissions y Roles, tal y como en el mensaje anterior...
|
||||
CREATE TABLE IF NOT EXISTS Permissions (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Name TEXT NOT NULL,
|
||||
Description TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS Roles (
|
||||
Id TEXT PRIMARY KEY,
|
||||
Name TEXT NOT NULL,
|
||||
Description TEXT,
|
||||
BaseRoleModelId TEXT,
|
||||
FOREIGN KEY (BaseRoleModelId) REFERENCES Roles(Id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS UserRoles (
|
||||
UserId TEXT NOT NULL,
|
||||
RoleId TEXT NOT NULL,
|
||||
PRIMARY KEY (UserId, RoleId),
|
||||
FOREIGN KEY (UserId) REFERENCES Users(Id),
|
||||
FOREIGN KEY (RoleId) REFERENCES Roles(Id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS RolePermissions (
|
||||
RoleId TEXT NOT NULL,
|
||||
PermissionId TEXT NOT NULL,
|
||||
PRIMARY KEY (RoleId, PermissionId),
|
||||
FOREIGN KEY (RoleId) REFERENCES Roles(Id),
|
||||
FOREIGN KEY (PermissionId) REFERENCES Permissions(Id)
|
||||
);
|
Reference in New Issue
Block a user