AltHeroes Bot v2
at main 160 lines 6.1 kB view raw
1// <auto-generated /> 2using System; 3using AltBot.Core.Models; 4using AltBot.Data; 5using Microsoft.EntityFrameworkCore; 6using Microsoft.EntityFrameworkCore.Infrastructure; 7using Microsoft.EntityFrameworkCore.Migrations; 8using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 9using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; 10 11#nullable disable 12 13namespace AltBot.Data.Migrations 14{ 15 [DbContext(typeof(DataContext))] 16 [Migration("20251023162128_AddHistoryTable")] 17 partial class AddHistoryTable 18 { 19 /// <inheritdoc /> 20 protected override void BuildTargetModel(ModelBuilder modelBuilder) 21 { 22#pragma warning disable 612, 618 23 modelBuilder 24 .HasAnnotation("ProductVersion", "9.0.10") 25 .HasAnnotation("Relational:MaxIdentifierLength", 63); 26 27 NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "label", new[] { "bronze", "gold", "hero", "none", "silver" }); 28 NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); 29 30 modelBuilder.Entity("AltBot.Core.Models.ImagePost", b => 31 { 32 b.Property<string>("Did") 33 .HasMaxLength(2048) 34 .HasColumnType("character varying(2048)") 35 .HasColumnName("did"); 36 37 b.Property<string>("Cid") 38 .HasMaxLength(1000) 39 .HasColumnType("character varying(1000)") 40 .HasColumnName("cid"); 41 42 b.Property<string>("Rkey") 43 .HasMaxLength(512) 44 .HasColumnType("character varying(512)") 45 .HasColumnName("rkey"); 46 47 b.Property<DateTime>("SeenAt") 48 .HasColumnType("timestamp with time zone") 49 .HasColumnName("seen_at"); 50 51 b.Property<bool>("ValidAlt") 52 .HasColumnType("boolean") 53 .HasColumnName("valid_alt"); 54 55 b.HasKey("Did", "Cid") 56 .HasName("pk_image_post"); 57 58 b.ToTable("image_post", (string)null); 59 }); 60 61 modelBuilder.Entity("AltBot.Core.Models.Subscriber", b => 62 { 63 b.Property<string>("Did") 64 .HasMaxLength(2048) 65 .HasColumnType("character varying(2048)") 66 .HasColumnName("did"); 67 68 b.Property<bool>("Active") 69 .ValueGeneratedOnAdd() 70 .HasColumnType("boolean") 71 .HasDefaultValue(true) 72 .HasColumnName("active"); 73 74 b.Property<string>("Handle") 75 .HasMaxLength(250) 76 .IsUnicode(true) 77 .HasColumnType("character varying(250)") 78 .HasColumnName("handle"); 79 80 b.Property<LabelLevel>("Label") 81 .HasColumnType("label") 82 .HasColumnName("label"); 83 84 b.Property<string>("Rkey") 85 .HasMaxLength(100) 86 .HasColumnType("character varying(100)") 87 .HasColumnName("rkey"); 88 89 b.Property<DateTime>("SeenAt") 90 .HasColumnType("timestamp with time zone") 91 .HasColumnName("seen_at"); 92 93 b.HasKey("Did") 94 .HasName("pk_subscriber"); 95 96 b.ToTable("subscriber", (string)null); 97 }); 98 99 modelBuilder.Entity("AltBot.Core.Models.SubscriberHistory", b => 100 { 101 b.Property<string>("Did") 102 .HasMaxLength(2048) 103 .HasColumnType("character varying(2048)") 104 .HasColumnName("did"); 105 106 b.Property<DateTime>("OccurredAt") 107 .HasColumnType("timestamp with time zone") 108 .HasColumnName("occurred_at"); 109 110 b.Property<string>("Action") 111 .IsRequired() 112 .HasColumnType("text") 113 .HasColumnName("action"); 114 115 b.Property<string>("Category") 116 .IsRequired() 117 .HasMaxLength(2048) 118 .HasColumnType("character varying(2048)") 119 .HasColumnName("category"); 120 121 b.HasKey("Did", "OccurredAt") 122 .HasName("pk_subscriber_history"); 123 124 b.ToTable("subscriber_history", (string)null); 125 }); 126 127 modelBuilder.Entity("AltBot.Core.Models.ImagePost", b => 128 { 129 b.HasOne("AltBot.Core.Models.Subscriber", "Subscriber") 130 .WithMany("Posts") 131 .HasForeignKey("Did") 132 .OnDelete(DeleteBehavior.Cascade) 133 .IsRequired() 134 .HasConstraintName("fk_image_post_subscriber"); 135 136 b.Navigation("Subscriber"); 137 }); 138 139 modelBuilder.Entity("AltBot.Core.Models.SubscriberHistory", b => 140 { 141 b.HasOne("AltBot.Core.Models.Subscriber", "Subscriber") 142 .WithMany("History") 143 .HasForeignKey("Did") 144 .OnDelete(DeleteBehavior.Cascade) 145 .IsRequired() 146 .HasConstraintName("fk_subscriber_history_subscriber"); 147 148 b.Navigation("Subscriber"); 149 }); 150 151 modelBuilder.Entity("AltBot.Core.Models.Subscriber", b => 152 { 153 b.Navigation("History"); 154 155 b.Navigation("Posts"); 156 }); 157#pragma warning restore 612, 618 158 } 159 } 160}