417 lines
15 KiB
C#
417 lines
15 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using OnlyPrompt.Backend.Database;
|
|
|
|
#nullable disable
|
|
|
|
namespace OnlyPrompt.Backend.Migrations
|
|
{
|
|
[DbContext(typeof(OnlyPromptContext))]
|
|
partial class OnlyPromptContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.5")
|
|
.HasAnnotation("Proxies:ChangeTracking", false)
|
|
.HasAnnotation("Proxies:CheckEquality", false)
|
|
.HasAnnotation("Proxies:LazyLoading", true)
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "citext");
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.CategoryModel", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Slug")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("citext");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.PromptModel", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("CreatorId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<string>("Prompt")
|
|
.IsRequired()
|
|
.HasMaxLength(4000)
|
|
.HasColumnType("character varying(4000)");
|
|
|
|
b.Property<string>("Slug")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("citext");
|
|
|
|
b.Property<Guid?>("SubscriptionTierId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("CreatorId");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("SubscriptionTierId");
|
|
|
|
b.ToTable("Prompts");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.ReviewModel", b =>
|
|
{
|
|
b.Property<Guid>("ReviewerId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PromptId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Comment")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Rating")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("ReviewerId", "PromptId");
|
|
|
|
b.HasIndex("PromptId");
|
|
|
|
b.ToTable("Reviews");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.SubscriptionModel", b =>
|
|
{
|
|
b.Property<Guid>("SubscriberId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("SubscribedToId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("SubscriptionTierId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("SubscriberId", "SubscribedToId");
|
|
|
|
b.HasIndex("SubscribedToId");
|
|
|
|
b.HasIndex("SubscriptionTierId");
|
|
|
|
b.ToTable("UserSubscriptions");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.SubscriptionTierModel", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<int>("Level")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<decimal>("MonthlyPrice")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.HasIndex("Level", "UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("SubscriptionTiers");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.UserModel", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("citext");
|
|
|
|
b.Property<bool>("IsLockoutEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.PrimitiveCollection<List<string>>("Roles")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("UserName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("citext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Email")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.UserProfileModel", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AvatarUrl")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Bio")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<bool>("IsPublic")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Slug")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("citext");
|
|
|
|
b.Property<string>("Specialities")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique();
|
|
|
|
b.ToTable("UserProfiles");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.PromptModel", b =>
|
|
{
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.CategoryModel", "Category")
|
|
.WithMany("Prompts")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "Creator")
|
|
.WithMany("Prompts")
|
|
.HasForeignKey("CreatorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.SubscriptionTierModel", "SubscriptionTier")
|
|
.WithMany("Prompts")
|
|
.HasForeignKey("SubscriptionTierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Creator");
|
|
|
|
b.Navigation("SubscriptionTier");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.ReviewModel", b =>
|
|
{
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.PromptModel", "Prompt")
|
|
.WithMany("Reviews")
|
|
.HasForeignKey("PromptId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "Reviewer")
|
|
.WithMany()
|
|
.HasForeignKey("ReviewerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Prompt");
|
|
|
|
b.Navigation("Reviewer");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.SubscriptionModel", b =>
|
|
{
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "SubscribedTo")
|
|
.WithMany("Subscribers")
|
|
.HasForeignKey("SubscribedToId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "Subscriber")
|
|
.WithMany("Subscriptions")
|
|
.HasForeignKey("SubscriberId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.SubscriptionTierModel", "SubscriptionTier")
|
|
.WithMany("Subscriptions")
|
|
.HasForeignKey("SubscriptionTierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("SubscribedTo");
|
|
|
|
b.Navigation("Subscriber");
|
|
|
|
b.Navigation("SubscriptionTier");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.SubscriptionTierModel", b =>
|
|
{
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.UserProfileModel", b =>
|
|
{
|
|
b.HasOne("OnlyPrompt.Backend.Database.Models.UserModel", "User")
|
|
.WithOne("Profile")
|
|
.HasForeignKey("OnlyPrompt.Backend.Database.Models.UserProfileModel", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.CategoryModel", b =>
|
|
{
|
|
b.Navigation("Prompts");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.PromptModel", b =>
|
|
{
|
|
b.Navigation("Reviews");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.SubscriptionTierModel", b =>
|
|
{
|
|
b.Navigation("Prompts");
|
|
|
|
b.Navigation("Subscriptions");
|
|
});
|
|
|
|
modelBuilder.Entity("OnlyPrompt.Backend.Database.Models.UserModel", b =>
|
|
{
|
|
b.Navigation("Profile")
|
|
.IsRequired();
|
|
|
|
b.Navigation("Prompts");
|
|
|
|
b.Navigation("Subscribers");
|
|
|
|
b.Navigation("Subscriptions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|