// using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using RegexBot.Data; #nullable disable namespace RegexBot.Data.Migrations { [DbContext(typeof(BotDatabaseContext))] [Migration("20220721021550_InitialMigration")] partial class InitialMigration { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "6.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("RegexBot.Data.CachedGuildMessage", b => { b.Property("MessageId") .HasColumnType("bigint") .HasColumnName("message_id"); b.Property>("AttachmentNames") .IsRequired() .HasColumnType("text[]") .HasColumnName("attachment_names"); b.Property("AuthorId") .HasColumnType("bigint") .HasColumnName("author_id"); b.Property("ChannelId") .HasColumnType("bigint") .HasColumnName("channel_id"); b.Property("Content") .IsRequired() .HasColumnType("text") .HasColumnName("content"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("EditedAt") .HasColumnType("timestamp with time zone") .HasColumnName("edited_at"); b.Property("GuildId") .HasColumnType("bigint") .HasColumnName("guild_id"); b.HasKey("MessageId") .HasName("pk_cache_guildmessages"); b.HasIndex("AuthorId") .HasDatabaseName("ix_cache_guildmessages_author_id"); b.ToTable("cache_guildmessages", (string)null); }); modelBuilder.Entity("RegexBot.Data.CachedGuildUser", b => { b.Property("UserId") .HasColumnType("bigint") .HasColumnName("user_id"); b.Property("GuildId") .HasColumnType("bigint") .HasColumnName("guild_id"); b.Property("FirstSeenTime") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasColumnName("first_seen_time") .HasDefaultValueSql("now()"); b.Property("GULastUpdateTime") .HasColumnType("timestamp with time zone") .HasColumnName("gu_last_update_time"); b.Property("Nickname") .HasColumnType("text") .HasColumnName("nickname"); b.HasKey("UserId", "GuildId") .HasName("pk_cache_usersinguild"); b.ToTable("cache_usersinguild", (string)null); }); modelBuilder.Entity("RegexBot.Data.CachedUser", b => { b.Property("UserId") .HasColumnType("bigint") .HasColumnName("user_id"); b.Property("AvatarUrl") .HasColumnType("text") .HasColumnName("avatar_url"); b.Property("Discriminator") .IsRequired() .HasMaxLength(4) .HasColumnType("character(4)") .HasColumnName("discriminator") .IsFixedLength(); b.Property("ULastUpdateTime") .HasColumnType("timestamp with time zone") .HasColumnName("u_last_update_time"); b.Property("Username") .IsRequired() .HasColumnType("text") .HasColumnName("username"); b.HasKey("UserId") .HasName("pk_cache_users"); b.ToTable("cache_users", (string)null); }); modelBuilder.Entity("RegexBot.Data.CachedGuildMessage", b => { b.HasOne("RegexBot.Data.CachedUser", "Author") .WithMany("GuildMessages") .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_cache_guildmessages_cache_users_author_id"); b.Navigation("Author"); }); modelBuilder.Entity("RegexBot.Data.CachedGuildUser", b => { b.HasOne("RegexBot.Data.CachedUser", "User") .WithMany("Guilds") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_cache_usersinguild_cache_users_user_id"); b.Navigation("User"); }); modelBuilder.Entity("RegexBot.Data.CachedUser", b => { b.Navigation("GuildMessages"); b.Navigation("Guilds"); }); #pragma warning restore 612, 618 } } }