// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Moonlight.Core.Database; #nullable disable namespace Moonlight.Core.Database.Migrations { [DbContext(typeof(DataContext))] partial class DataContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); modelBuilder.Entity("Moonlight.Core.Database.Entities.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Avatar") .HasColumnType("TEXT"); b.Property("Balance") .HasColumnType("REAL"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Email") .IsRequired() .HasColumnType("TEXT"); b.Property("Flags") .IsRequired() .HasColumnType("TEXT"); b.Property("Password") .IsRequired() .HasColumnType("TEXT"); b.Property("Permissions") .HasColumnType("INTEGER"); b.Property("TokenValidTimestamp") .HasColumnType("TEXT"); b.Property("TotpKey") .HasColumnType("TEXT"); b.Property("Username") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.Post", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AuthorId") .HasColumnType("INTEGER"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Title") .IsRequired() .HasColumnType("TEXT"); b.Property("Type") .HasColumnType("INTEGER"); b.Property("UpdatedAt") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.ToTable("Posts"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.PostComment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AuthorId") .HasColumnType("INTEGER"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("PostId") .HasColumnType("INTEGER"); b.Property("UpdatedAt") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.HasIndex("PostId"); b.ToTable("PostComments"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.PostLike", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("PostId") .HasColumnType("INTEGER"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("PostId"); b.HasIndex("UserId"); b.ToTable("PostLikes"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.WordFilter", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Filter") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("WordFilters"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.Server", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Cpu") .HasColumnType("INTEGER"); b.Property("Disk") .HasColumnType("INTEGER"); b.Property("DockerImageIndex") .HasColumnType("INTEGER"); b.Property("ImageId") .HasColumnType("INTEGER"); b.Property("MainAllocationId") .HasColumnType("INTEGER"); b.Property("Memory") .HasColumnType("INTEGER"); b.Property("NodeId") .HasColumnType("INTEGER"); b.Property("OverrideStartupCommand") .HasColumnType("TEXT"); b.Property("ServiceId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ImageId"); b.HasIndex("MainAllocationId"); b.HasIndex("NodeId"); b.HasIndex("ServiceId"); b.ToTable("Servers"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerAllocation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("IpAddress") .IsRequired() .HasColumnType("TEXT"); b.Property("Port") .HasColumnType("INTEGER"); b.Property("ServerId") .HasColumnType("INTEGER"); b.Property("ServerNodeId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ServerId"); b.HasIndex("ServerNodeId"); b.ToTable("ServerAllocations"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerDockerImage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AutoPull") .HasColumnType("INTEGER"); b.Property("DisplayName") .IsRequired() .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("ServerImageId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ServerImageId"); b.ToTable("ServerDockerImages"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerImage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AllocationsNeeded") .HasColumnType("INTEGER"); b.Property("Author") .IsRequired() .HasColumnType("TEXT"); b.Property("DefaultDockerImageIndex") .HasColumnType("INTEGER"); b.Property("DonateUrl") .HasColumnType("TEXT"); b.Property("InstallDockerImage") .IsRequired() .HasColumnType("TEXT"); b.Property("InstallScript") .IsRequired() .HasColumnType("TEXT"); b.Property("InstallShell") .IsRequired() .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("OnlineDetection") .IsRequired() .HasColumnType("TEXT"); b.Property("ParseConfigurations") .IsRequired() .HasColumnType("TEXT"); b.Property("StartupCommand") .IsRequired() .HasColumnType("TEXT"); b.Property("StopCommand") .IsRequired() .HasColumnType("TEXT"); b.Property("UpdateUrl") .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("ServerImages"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerImageVariable", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("AllowUserToEdit") .HasColumnType("INTEGER"); b.Property("AllowUserToView") .HasColumnType("INTEGER"); b.Property("DefaultValue") .IsRequired() .HasColumnType("TEXT"); b.Property("Description") .IsRequired() .HasColumnType("TEXT"); b.Property("DisplayName") .IsRequired() .HasColumnType("TEXT"); b.Property("Key") .IsRequired() .HasColumnType("TEXT"); b.Property("ServerImageId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ServerImageId"); b.ToTable("ServerImageVariables"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerNode", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Fqdn") .IsRequired() .HasColumnType("TEXT"); b.Property("FtpPort") .HasColumnType("INTEGER"); b.Property("HttpPort") .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("Token") .IsRequired() .HasColumnType("TEXT"); b.Property("UseSsl") .HasColumnType("INTEGER"); b.HasKey("Id"); b.ToTable("ServerNodes"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerVariable", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Key") .IsRequired() .HasColumnType("TEXT"); b.Property("ServerId") .HasColumnType("INTEGER"); b.Property("Value") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("ServerId"); b.ToTable("ServerVariables"); }); modelBuilder.Entity("Moonlight.Features.ServiceManagement.Entities.Service", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("ConfigJsonOverride") .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Nickname") .HasColumnType("TEXT"); b.Property("OwnerId") .HasColumnType("INTEGER"); b.Property("ProductId") .HasColumnType("INTEGER"); b.Property("RenewAt") .HasColumnType("TEXT"); b.Property("Suspended") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("OwnerId"); b.HasIndex("ProductId"); b.ToTable("Services"); }); modelBuilder.Entity("Moonlight.Features.ServiceManagement.Entities.ServiceShare", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("ServiceId") .HasColumnType("INTEGER"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ServiceId"); b.HasIndex("UserId"); b.ToTable("ServiceShares"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Category", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Description") .IsRequired() .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("Slug") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("Categories"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Coupon", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Amount") .HasColumnType("INTEGER"); b.Property("Code") .IsRequired() .HasColumnType("TEXT"); b.Property("Percent") .HasColumnType("INTEGER"); b.HasKey("Id"); b.ToTable("Coupons"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.CouponUse", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CouponId") .HasColumnType("INTEGER"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("CouponId"); b.HasIndex("UserId"); b.ToTable("CouponUses"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.GiftCode", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Amount") .HasColumnType("INTEGER"); b.Property("Code") .IsRequired() .HasColumnType("TEXT"); b.Property("Value") .HasColumnType("REAL"); b.HasKey("Id"); b.ToTable("GiftCodes"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.GiftCodeUse", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("GiftCodeId") .HasColumnType("INTEGER"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("GiftCodeId"); b.HasIndex("UserId"); b.ToTable("GiftCodeUses"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Product", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CategoryId") .HasColumnType("INTEGER"); b.Property("ConfigJson") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Description") .IsRequired() .HasColumnType("TEXT"); b.Property("Duration") .HasColumnType("INTEGER"); b.Property("MaxPerUser") .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("Price") .HasColumnType("REAL"); b.Property("Slug") .IsRequired() .HasColumnType("TEXT"); b.Property("Stock") .HasColumnType("INTEGER"); b.Property("Type") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("CategoryId"); b.ToTable("Products"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Transaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("Price") .HasColumnType("REAL"); b.Property("Text") .IsRequired() .HasColumnType("TEXT"); b.Property("UserId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Transaction"); }); modelBuilder.Entity("Moonlight.Features.Theming.Entities.Theme", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Author") .IsRequired() .HasColumnType("TEXT"); b.Property("CssUrl") .IsRequired() .HasColumnType("TEXT"); b.Property("DonateUrl") .HasColumnType("TEXT"); b.Property("Enabled") .HasColumnType("INTEGER"); b.Property("JsUrl") .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("Themes"); }); modelBuilder.Entity("Moonlight.Features.Ticketing.Entities.Ticket", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("CreatorId") .HasColumnType("INTEGER"); b.Property("Description") .IsRequired() .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("Open") .HasColumnType("INTEGER"); b.Property("Priority") .HasColumnType("INTEGER"); b.Property("ServiceId") .HasColumnType("INTEGER"); b.Property("Tries") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("CreatorId"); b.HasIndex("ServiceId"); b.ToTable("Tickets"); }); modelBuilder.Entity("Moonlight.Features.Ticketing.Entities.TicketMessage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Attachment") .HasColumnType("TEXT"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); b.Property("CreatedAt") .HasColumnType("TEXT"); b.Property("IsSupport") .HasColumnType("INTEGER"); b.Property("SenderId") .HasColumnType("INTEGER"); b.Property("TicketId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("SenderId"); b.HasIndex("TicketId"); b.ToTable("TicketMessages"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.Post", b => { b.HasOne("Moonlight.Core.Database.Entities.User", "Author") .WithMany() .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Author"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.PostComment", b => { b.HasOne("Moonlight.Core.Database.Entities.User", "Author") .WithMany() .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.Community.Entities.Post", null) .WithMany("Comments") .HasForeignKey("PostId"); b.Navigation("Author"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.PostLike", b => { b.HasOne("Moonlight.Features.Community.Entities.Post", null) .WithMany("Likes") .HasForeignKey("PostId"); b.HasOne("Moonlight.Core.Database.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.Server", b => { b.HasOne("Moonlight.Features.Servers.Entities.ServerImage", "Image") .WithMany() .HasForeignKey("ImageId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.Servers.Entities.ServerAllocation", "MainAllocation") .WithMany() .HasForeignKey("MainAllocationId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.Servers.Entities.ServerNode", "Node") .WithMany() .HasForeignKey("NodeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.ServiceManagement.Entities.Service", "Service") .WithMany() .HasForeignKey("ServiceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Image"); b.Navigation("MainAllocation"); b.Navigation("Node"); b.Navigation("Service"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerAllocation", b => { b.HasOne("Moonlight.Features.Servers.Entities.Server", null) .WithMany("Allocations") .HasForeignKey("ServerId"); b.HasOne("Moonlight.Features.Servers.Entities.ServerNode", null) .WithMany("Allocations") .HasForeignKey("ServerNodeId"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerDockerImage", b => { b.HasOne("Moonlight.Features.Servers.Entities.ServerImage", null) .WithMany("DockerImages") .HasForeignKey("ServerImageId"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerImageVariable", b => { b.HasOne("Moonlight.Features.Servers.Entities.ServerImage", null) .WithMany("Variables") .HasForeignKey("ServerImageId"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerVariable", b => { b.HasOne("Moonlight.Features.Servers.Entities.Server", null) .WithMany("Variables") .HasForeignKey("ServerId"); }); modelBuilder.Entity("Moonlight.Features.ServiceManagement.Entities.Service", b => { b.HasOne("Moonlight.Core.Database.Entities.User", "Owner") .WithMany() .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.StoreSystem.Entities.Product", "Product") .WithMany() .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Owner"); b.Navigation("Product"); }); modelBuilder.Entity("Moonlight.Features.ServiceManagement.Entities.ServiceShare", b => { b.HasOne("Moonlight.Features.ServiceManagement.Entities.Service", null) .WithMany("Shares") .HasForeignKey("ServiceId"); b.HasOne("Moonlight.Core.Database.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.CouponUse", b => { b.HasOne("Moonlight.Features.StoreSystem.Entities.Coupon", "Coupon") .WithMany() .HasForeignKey("CouponId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Core.Database.Entities.User", null) .WithMany("CouponUses") .HasForeignKey("UserId"); b.Navigation("Coupon"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.GiftCodeUse", b => { b.HasOne("Moonlight.Features.StoreSystem.Entities.GiftCode", "GiftCode") .WithMany() .HasForeignKey("GiftCodeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Core.Database.Entities.User", null) .WithMany("GiftCodeUses") .HasForeignKey("UserId"); b.Navigation("GiftCode"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Product", b => { b.HasOne("Moonlight.Features.StoreSystem.Entities.Category", "Category") .WithMany() .HasForeignKey("CategoryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Category"); }); modelBuilder.Entity("Moonlight.Features.StoreSystem.Entities.Transaction", b => { b.HasOne("Moonlight.Core.Database.Entities.User", null) .WithMany("Transactions") .HasForeignKey("UserId"); }); modelBuilder.Entity("Moonlight.Features.Ticketing.Entities.Ticket", b => { b.HasOne("Moonlight.Core.Database.Entities.User", "Creator") .WithMany() .HasForeignKey("CreatorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Moonlight.Features.ServiceManagement.Entities.Service", "Service") .WithMany() .HasForeignKey("ServiceId"); b.Navigation("Creator"); b.Navigation("Service"); }); modelBuilder.Entity("Moonlight.Features.Ticketing.Entities.TicketMessage", b => { b.HasOne("Moonlight.Core.Database.Entities.User", "Sender") .WithMany() .HasForeignKey("SenderId"); b.HasOne("Moonlight.Features.Ticketing.Entities.Ticket", null) .WithMany("Messages") .HasForeignKey("TicketId"); b.Navigation("Sender"); }); modelBuilder.Entity("Moonlight.Core.Database.Entities.User", b => { b.Navigation("CouponUses"); b.Navigation("GiftCodeUses"); b.Navigation("Transactions"); }); modelBuilder.Entity("Moonlight.Features.Community.Entities.Post", b => { b.Navigation("Comments"); b.Navigation("Likes"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.Server", b => { b.Navigation("Allocations"); b.Navigation("Variables"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerImage", b => { b.Navigation("DockerImages"); b.Navigation("Variables"); }); modelBuilder.Entity("Moonlight.Features.Servers.Entities.ServerNode", b => { b.Navigation("Allocations"); }); modelBuilder.Entity("Moonlight.Features.ServiceManagement.Entities.Service", b => { b.Navigation("Shares"); }); modelBuilder.Entity("Moonlight.Features.Ticketing.Entities.Ticket", b => { b.Navigation("Messages"); }); #pragma warning restore 612, 618 } } }