mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
ce013eae49
+ InvitesRepository + AdminsRepository + rework jwt
332 lines
11 KiB
C#
332 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Govor.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace Govor.Data.Migrations
|
|
{
|
|
[DbContext(typeof(GovorDbContext))]
|
|
[Migration("20250624053837_FixAdminRelation")]
|
|
partial class FixAdminRelation
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.6")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.Admin", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("UserId");
|
|
|
|
b.ToTable("Admins");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.ChatGroup", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.PrimitiveCollection<List<Guid>>("Admins")
|
|
.IsRequired()
|
|
.HasColumnType("uuid[]");
|
|
|
|
b.PrimitiveCollection<List<string>>("InviteCode")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.Property<bool>("IsChannel")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsPrivate")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ChatGroups");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.GroupAdmins", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("GroupId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("GroupAdmins");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.GroupMembership", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("GroupId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsBanned")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("GroupMemberships");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MediaAttachments", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("EncryptedKey")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<string>("FilePath")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("MessageId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("MimeType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("MessageId");
|
|
|
|
b.ToTable("MediaAttachments");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.Message", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime?>("EditedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("EncryptedContent")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsEdited")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid>("RecipientId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("RecipientType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid?>("ReplyToMessageId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("SenderId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("SentAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ReplyToMessageId");
|
|
|
|
b.ToTable("Messages");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MessageReaction", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("MessageId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("ReactedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("ReactionCode")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.HasIndex("MessageId", "UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("MessageReactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MessageView", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("MessageId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("ViewedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("MessageId", "UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("MessageViews");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateOnly>("CreatedOn")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("IconId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("WasOnline")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.Admin", b =>
|
|
{
|
|
b.HasOne("Govor.Core.Models.User", "User")
|
|
.WithOne()
|
|
.HasForeignKey("Govor.Core.Models.Admin", "UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MediaAttachments", b =>
|
|
{
|
|
b.HasOne("Govor.Core.Models.Message", "Message")
|
|
.WithMany("MediaAttachments")
|
|
.HasForeignKey("MessageId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Message");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.Message", b =>
|
|
{
|
|
b.HasOne("Govor.Core.Models.Message", "ReplyToMessage")
|
|
.WithMany()
|
|
.HasForeignKey("ReplyToMessageId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("ReplyToMessage");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MessageReaction", b =>
|
|
{
|
|
b.HasOne("Govor.Core.Models.Message", "Message")
|
|
.WithMany("Reactions")
|
|
.HasForeignKey("MessageId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Govor.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Message");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.MessageView", b =>
|
|
{
|
|
b.HasOne("Govor.Core.Models.Message", null)
|
|
.WithMany("MessageViews")
|
|
.HasForeignKey("MessageId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Govor.Core.Models.Message", b =>
|
|
{
|
|
b.Navigation("MediaAttachments");
|
|
|
|
b.Navigation("MessageViews");
|
|
|
|
b.Navigation("Reactions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|