//
using System;
using EchoHub.Server.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EchoHub.Server.Data.Migrations
{
[DbContext(typeof(EchoHubDbContext))]
partial class EchoHubDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.3");
modelBuilder.Entity("EchoHub.Core.Models.Channel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("INTEGER");
b.Property("CreatedByUserId")
.HasColumnType("TEXT");
b.Property("IsPublic")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Topic")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Channels");
});
modelBuilder.Entity("EchoHub.Core.Models.Message", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AttachmentFileName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("AttachmentUrl")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("ChannelId")
.HasColumnType("TEXT");
b.Property("Content")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property("SenderUserId")
.HasColumnType("TEXT");
b.Property("SenderUsername")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("SentAt")
.HasColumnType("INTEGER");
b.Property("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ChannelId");
b.HasIndex("SentAt");
b.ToTable("Messages");
});
modelBuilder.Entity("EchoHub.Core.Models.RefreshToken", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("INTEGER");
b.Property("ExpiresAt")
.HasColumnType("INTEGER");
b.Property("RevokedAt")
.HasColumnType("INTEGER");
b.Property("TokenHash")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("TokenHash");
b.HasIndex("UserId");
b.ToTable("RefreshTokens");
});
modelBuilder.Entity("EchoHub.Core.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AvatarAscii")
.HasMaxLength(10000)
.HasColumnType("TEXT");
b.Property("Bio")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("INTEGER");
b.Property("DisplayName")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("IsBanned")
.HasColumnType("INTEGER");
b.Property("IsMuted")
.HasColumnType("INTEGER");
b.Property("LastSeenAt")
.HasColumnType("INTEGER");
b.Property("MutedUntil")
.HasColumnType("INTEGER");
b.Property("NicknameColor")
.HasMaxLength(7)
.HasColumnType("TEXT");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Role")
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("StatusMessage")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Username")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("EchoHub.Core.Models.Message", b =>
{
b.HasOne("EchoHub.Core.Models.Channel", "Channel")
.WithMany("Messages")
.HasForeignKey("ChannelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Channel");
});
modelBuilder.Entity("EchoHub.Core.Models.RefreshToken", b =>
{
b.HasOne("EchoHub.Core.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("EchoHub.Core.Models.Channel", b =>
{
b.Navigation("Messages");
});
#pragma warning restore 612, 618
}
}
}