| [877c13c] | 1 | // <auto-generated />
|
|---|
| 2 | using System;
|
|---|
| 3 | using ChapterX.Infrastructure.Data.DataContext;
|
|---|
| 4 | using Microsoft.EntityFrameworkCore;
|
|---|
| 5 | using Microsoft.EntityFrameworkCore.Infrastructure;
|
|---|
| 6 | using Microsoft.EntityFrameworkCore.Migrations;
|
|---|
| 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|---|
| 8 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|---|
| 9 |
|
|---|
| 10 | #nullable disable
|
|---|
| 11 |
|
|---|
| 12 | namespace ChapterX.Infrastructure.Migrations
|
|---|
| 13 | {
|
|---|
| 14 | [DbContext(typeof(ApplicationDbContext))]
|
|---|
| 15 | [Migration("20260319165534_InitialCreate1")]
|
|---|
| 16 | partial class InitialCreate1
|
|---|
| 17 | {
|
|---|
| 18 | /// <inheritdoc />
|
|---|
| 19 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|---|
| 20 | {
|
|---|
| 21 | #pragma warning disable 612, 618
|
|---|
| 22 | modelBuilder
|
|---|
| 23 | .HasAnnotation("ProductVersion", "9.0.1")
|
|---|
| 24 | .HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|---|
| 25 |
|
|---|
| 26 | NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|---|
| 27 |
|
|---|
| 28 | modelBuilder.Entity("ChapterX.Domain.Entities.AISuggestion", b =>
|
|---|
| 29 | {
|
|---|
| 30 | b.Property<int>("Id")
|
|---|
| 31 | .ValueGeneratedOnAdd()
|
|---|
| 32 | .HasColumnType("integer");
|
|---|
| 33 |
|
|---|
| 34 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 35 |
|
|---|
| 36 | b.Property<bool>("Accepted")
|
|---|
| 37 | .HasColumnType("boolean");
|
|---|
| 38 |
|
|---|
| 39 | b.Property<DateTime?>("AppliedAt")
|
|---|
| 40 | .HasColumnType("timestamp with time zone");
|
|---|
| 41 |
|
|---|
| 42 | b.Property<DateTime>("CreatedAt")
|
|---|
| 43 | .HasColumnType("timestamp with time zone");
|
|---|
| 44 |
|
|---|
| 45 | b.Property<string>("OriginalText")
|
|---|
| 46 | .IsRequired()
|
|---|
| 47 | .HasColumnType("text");
|
|---|
| 48 |
|
|---|
| 49 | b.Property<int>("StoryId")
|
|---|
| 50 | .HasColumnType("integer");
|
|---|
| 51 |
|
|---|
| 52 | b.Property<string>("SuggestedText")
|
|---|
| 53 | .IsRequired()
|
|---|
| 54 | .HasColumnType("text");
|
|---|
| 55 |
|
|---|
| 56 | b.PrimitiveCollection<int[]>("SuggestionTypes")
|
|---|
| 57 | .IsRequired()
|
|---|
| 58 | .HasColumnType("integer[]");
|
|---|
| 59 |
|
|---|
| 60 | b.HasKey("Id");
|
|---|
| 61 |
|
|---|
| 62 | b.HasIndex("StoryId");
|
|---|
| 63 |
|
|---|
| 64 | b.ToTable("AISuggestions");
|
|---|
| 65 | });
|
|---|
| 66 |
|
|---|
| 67 | modelBuilder.Entity("ChapterX.Domain.Entities.Admin", b =>
|
|---|
| 68 | {
|
|---|
| 69 | b.Property<int>("Id")
|
|---|
| 70 | .ValueGeneratedOnAdd()
|
|---|
| 71 | .HasColumnType("integer");
|
|---|
| 72 |
|
|---|
| 73 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 74 |
|
|---|
| 75 | b.Property<int>("UserId")
|
|---|
| 76 | .HasColumnType("integer");
|
|---|
| 77 |
|
|---|
| 78 | b.HasKey("Id");
|
|---|
| 79 |
|
|---|
| 80 | b.HasIndex("UserId")
|
|---|
| 81 | .IsUnique();
|
|---|
| 82 |
|
|---|
| 83 | b.ToTable("Admins");
|
|---|
| 84 | });
|
|---|
| 85 |
|
|---|
| 86 | modelBuilder.Entity("ChapterX.Domain.Entities.Chapter", b =>
|
|---|
| 87 | {
|
|---|
| 88 | b.Property<int>("Id")
|
|---|
| 89 | .ValueGeneratedOnAdd()
|
|---|
| 90 | .HasColumnType("integer");
|
|---|
| 91 |
|
|---|
| 92 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 93 |
|
|---|
| 94 | b.Property<string>("Content")
|
|---|
| 95 | .IsRequired()
|
|---|
| 96 | .HasColumnType("text");
|
|---|
| 97 |
|
|---|
| 98 | b.Property<DateTime>("CreatedAt")
|
|---|
| 99 | .HasColumnType("timestamp with time zone");
|
|---|
| 100 |
|
|---|
| 101 | b.Property<string>("Name")
|
|---|
| 102 | .IsRequired()
|
|---|
| 103 | .HasColumnType("text");
|
|---|
| 104 |
|
|---|
| 105 | b.Property<int>("Number")
|
|---|
| 106 | .HasColumnType("integer");
|
|---|
| 107 |
|
|---|
| 108 | b.Property<DateTime>("PublishedAt")
|
|---|
| 109 | .HasColumnType("timestamp with time zone");
|
|---|
| 110 |
|
|---|
| 111 | b.Property<decimal?>("Rating")
|
|---|
| 112 | .HasColumnType("numeric");
|
|---|
| 113 |
|
|---|
| 114 | b.Property<int>("StoryId")
|
|---|
| 115 | .HasColumnType("integer");
|
|---|
| 116 |
|
|---|
| 117 | b.Property<string>("Title")
|
|---|
| 118 | .IsRequired()
|
|---|
| 119 | .HasColumnType("text");
|
|---|
| 120 |
|
|---|
| 121 | b.Property<DateTime>("UpdatedAt")
|
|---|
| 122 | .HasColumnType("timestamp with time zone");
|
|---|
| 123 |
|
|---|
| 124 | b.Property<int>("ViewCount")
|
|---|
| 125 | .HasColumnType("integer");
|
|---|
| 126 |
|
|---|
| 127 | b.Property<int?>("WordCount")
|
|---|
| 128 | .HasColumnType("integer");
|
|---|
| 129 |
|
|---|
| 130 | b.HasKey("Id");
|
|---|
| 131 |
|
|---|
| 132 | b.HasIndex("StoryId");
|
|---|
| 133 |
|
|---|
| 134 | b.ToTable("Chapters");
|
|---|
| 135 | });
|
|---|
| 136 |
|
|---|
| 137 | modelBuilder.Entity("ChapterX.Domain.Entities.Collaboration", b =>
|
|---|
| 138 | {
|
|---|
| 139 | b.Property<int>("Id")
|
|---|
| 140 | .ValueGeneratedOnAdd()
|
|---|
| 141 | .HasColumnType("integer");
|
|---|
| 142 |
|
|---|
| 143 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 144 |
|
|---|
| 145 | b.Property<DateTime>("JoinedAt")
|
|---|
| 146 | .HasColumnType("timestamp with time zone");
|
|---|
| 147 |
|
|---|
| 148 | b.Property<string>("Role")
|
|---|
| 149 | .IsRequired()
|
|---|
| 150 | .HasColumnType("text");
|
|---|
| 151 |
|
|---|
| 152 | b.Property<int>("StoryId")
|
|---|
| 153 | .HasColumnType("integer");
|
|---|
| 154 |
|
|---|
| 155 | b.Property<int>("UserId")
|
|---|
| 156 | .HasColumnType("integer");
|
|---|
| 157 |
|
|---|
| 158 | b.HasKey("Id");
|
|---|
| 159 |
|
|---|
| 160 | b.HasIndex("StoryId");
|
|---|
| 161 |
|
|---|
| 162 | b.HasIndex("UserId");
|
|---|
| 163 |
|
|---|
| 164 | b.ToTable("Collaborations");
|
|---|
| 165 | });
|
|---|
| 166 |
|
|---|
| 167 | modelBuilder.Entity("ChapterX.Domain.Entities.Comment", b =>
|
|---|
| 168 | {
|
|---|
| 169 | b.Property<int>("Id")
|
|---|
| 170 | .ValueGeneratedOnAdd()
|
|---|
| 171 | .HasColumnType("integer");
|
|---|
| 172 |
|
|---|
| 173 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 174 |
|
|---|
| 175 | b.Property<string>("Content")
|
|---|
| 176 | .IsRequired()
|
|---|
| 177 | .HasColumnType("text");
|
|---|
| 178 |
|
|---|
| 179 | b.Property<DateTime>("CreatedAt")
|
|---|
| 180 | .HasColumnType("timestamp with time zone");
|
|---|
| 181 |
|
|---|
| 182 | b.Property<int>("StoryId")
|
|---|
| 183 | .HasColumnType("integer");
|
|---|
| 184 |
|
|---|
| 185 | b.Property<DateTime>("UpdatedAt")
|
|---|
| 186 | .HasColumnType("timestamp with time zone");
|
|---|
| 187 |
|
|---|
| 188 | b.Property<int>("UserId")
|
|---|
| 189 | .HasColumnType("integer");
|
|---|
| 190 |
|
|---|
| 191 | b.HasKey("Id");
|
|---|
| 192 |
|
|---|
| 193 | b.HasIndex("StoryId");
|
|---|
| 194 |
|
|---|
| 195 | b.HasIndex("UserId");
|
|---|
| 196 |
|
|---|
| 197 | b.ToTable("Comments");
|
|---|
| 198 | });
|
|---|
| 199 |
|
|---|
| 200 | modelBuilder.Entity("ChapterX.Domain.Entities.Genre", b =>
|
|---|
| 201 | {
|
|---|
| 202 | b.Property<int>("Id")
|
|---|
| 203 | .ValueGeneratedOnAdd()
|
|---|
| 204 | .HasColumnType("integer");
|
|---|
| 205 |
|
|---|
| 206 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 207 |
|
|---|
| 208 | b.Property<string>("Name")
|
|---|
| 209 | .IsRequired()
|
|---|
| 210 | .HasColumnType("text");
|
|---|
| 211 |
|
|---|
| 212 | b.HasKey("Id");
|
|---|
| 213 |
|
|---|
| 214 | b.ToTable("Genres");
|
|---|
| 215 | });
|
|---|
| 216 |
|
|---|
| 217 | modelBuilder.Entity("ChapterX.Domain.Entities.HasGenre", b =>
|
|---|
| 218 | {
|
|---|
| 219 | b.Property<int>("Id")
|
|---|
| 220 | .ValueGeneratedOnAdd()
|
|---|
| 221 | .HasColumnType("integer");
|
|---|
| 222 |
|
|---|
| 223 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 224 |
|
|---|
| 225 | b.Property<int>("GenreId")
|
|---|
| 226 | .HasColumnType("integer");
|
|---|
| 227 |
|
|---|
| 228 | b.Property<int>("StoryId")
|
|---|
| 229 | .HasColumnType("integer");
|
|---|
| 230 |
|
|---|
| 231 | b.HasKey("Id");
|
|---|
| 232 |
|
|---|
| 233 | b.HasIndex("GenreId");
|
|---|
| 234 |
|
|---|
| 235 | b.HasIndex("StoryId");
|
|---|
| 236 |
|
|---|
| 237 | b.ToTable("HasGenres");
|
|---|
| 238 | });
|
|---|
| 239 |
|
|---|
| 240 | modelBuilder.Entity("ChapterX.Domain.Entities.Likes", b =>
|
|---|
| 241 | {
|
|---|
| 242 | b.Property<int>("Id")
|
|---|
| 243 | .ValueGeneratedOnAdd()
|
|---|
| 244 | .HasColumnType("integer");
|
|---|
| 245 |
|
|---|
| 246 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 247 |
|
|---|
| 248 | b.Property<int>("ChapterId")
|
|---|
| 249 | .HasColumnType("integer");
|
|---|
| 250 |
|
|---|
| 251 | b.Property<DateTime>("CreatedAt")
|
|---|
| 252 | .HasColumnType("timestamp with time zone");
|
|---|
| 253 |
|
|---|
| 254 | b.Property<int?>("StoryId")
|
|---|
| 255 | .HasColumnType("integer");
|
|---|
| 256 |
|
|---|
| 257 | b.Property<int>("UserId")
|
|---|
| 258 | .HasColumnType("integer");
|
|---|
| 259 |
|
|---|
| 260 | b.HasKey("Id");
|
|---|
| 261 |
|
|---|
| 262 | b.HasIndex("ChapterId");
|
|---|
| 263 |
|
|---|
| 264 | b.HasIndex("StoryId");
|
|---|
| 265 |
|
|---|
| 266 | b.HasIndex("UserId");
|
|---|
| 267 |
|
|---|
| 268 | b.ToTable("Likes");
|
|---|
| 269 | });
|
|---|
| 270 |
|
|---|
| 271 | modelBuilder.Entity("ChapterX.Domain.Entities.NeedApproval", b =>
|
|---|
| 272 | {
|
|---|
| 273 | b.Property<int>("Id")
|
|---|
| 274 | .ValueGeneratedOnAdd()
|
|---|
| 275 | .HasColumnType("integer");
|
|---|
| 276 |
|
|---|
| 277 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 278 |
|
|---|
| 279 | b.Property<int?>("AISuggestionId")
|
|---|
| 280 | .HasColumnType("integer");
|
|---|
| 281 |
|
|---|
| 282 | b.Property<int>("AdminId")
|
|---|
| 283 | .HasColumnType("integer");
|
|---|
| 284 |
|
|---|
| 285 | b.Property<bool>("Approved")
|
|---|
| 286 | .HasColumnType("boolean");
|
|---|
| 287 |
|
|---|
| 288 | b.Property<int?>("ChapterId")
|
|---|
| 289 | .HasColumnType("integer");
|
|---|
| 290 |
|
|---|
| 291 | b.Property<DateTime>("RequestedAt")
|
|---|
| 292 | .HasColumnType("timestamp with time zone");
|
|---|
| 293 |
|
|---|
| 294 | b.Property<int>("StoryId")
|
|---|
| 295 | .HasColumnType("integer");
|
|---|
| 296 |
|
|---|
| 297 | b.HasKey("Id");
|
|---|
| 298 |
|
|---|
| 299 | b.HasIndex("AISuggestionId");
|
|---|
| 300 |
|
|---|
| 301 | b.HasIndex("AdminId");
|
|---|
| 302 |
|
|---|
| 303 | b.HasIndex("ChapterId");
|
|---|
| 304 |
|
|---|
| 305 | b.HasIndex("StoryId");
|
|---|
| 306 |
|
|---|
| 307 | b.ToTable("NeedApprovals");
|
|---|
| 308 | });
|
|---|
| 309 |
|
|---|
| 310 | modelBuilder.Entity("ChapterX.Domain.Entities.Notification", b =>
|
|---|
| 311 | {
|
|---|
| 312 | b.Property<int>("Id")
|
|---|
| 313 | .ValueGeneratedOnAdd()
|
|---|
| 314 | .HasColumnType("integer");
|
|---|
| 315 |
|
|---|
| 316 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 317 |
|
|---|
| 318 | b.Property<string>("Content")
|
|---|
| 319 | .IsRequired()
|
|---|
| 320 | .HasColumnType("text");
|
|---|
| 321 |
|
|---|
| 322 | b.PrimitiveCollection<int[]>("ContentTypes")
|
|---|
| 323 | .IsRequired()
|
|---|
| 324 | .HasColumnType("integer[]");
|
|---|
| 325 |
|
|---|
| 326 | b.Property<DateTime>("CreatedAt")
|
|---|
| 327 | .HasColumnType("timestamp with time zone");
|
|---|
| 328 |
|
|---|
| 329 | b.Property<bool>("IsRead")
|
|---|
| 330 | .HasColumnType("boolean");
|
|---|
| 331 |
|
|---|
| 332 | b.HasKey("Id");
|
|---|
| 333 |
|
|---|
| 334 | b.ToTable("Notifications");
|
|---|
| 335 | });
|
|---|
| 336 |
|
|---|
| 337 | modelBuilder.Entity("ChapterX.Domain.Entities.Notify", b =>
|
|---|
| 338 | {
|
|---|
| 339 | b.Property<int>("Id")
|
|---|
| 340 | .ValueGeneratedOnAdd()
|
|---|
| 341 | .HasColumnType("integer");
|
|---|
| 342 |
|
|---|
| 343 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 344 |
|
|---|
| 345 | b.Property<bool>("IsRead")
|
|---|
| 346 | .HasColumnType("boolean");
|
|---|
| 347 |
|
|---|
| 348 | b.Property<int>("NotificationId")
|
|---|
| 349 | .HasColumnType("integer");
|
|---|
| 350 |
|
|---|
| 351 | b.Property<int?>("StoryId")
|
|---|
| 352 | .HasColumnType("integer");
|
|---|
| 353 |
|
|---|
| 354 | b.Property<int>("UserId")
|
|---|
| 355 | .HasColumnType("integer");
|
|---|
| 356 |
|
|---|
| 357 | b.HasKey("Id");
|
|---|
| 358 |
|
|---|
| 359 | b.HasIndex("NotificationId");
|
|---|
| 360 |
|
|---|
| 361 | b.HasIndex("StoryId");
|
|---|
| 362 |
|
|---|
| 363 | b.HasIndex("UserId");
|
|---|
| 364 |
|
|---|
| 365 | b.ToTable("Notifies");
|
|---|
| 366 | });
|
|---|
| 367 |
|
|---|
| 368 | modelBuilder.Entity("ChapterX.Domain.Entities.ReadingList", b =>
|
|---|
| 369 | {
|
|---|
| 370 | b.Property<int>("Id")
|
|---|
| 371 | .ValueGeneratedOnAdd()
|
|---|
| 372 | .HasColumnType("integer");
|
|---|
| 373 |
|
|---|
| 374 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 375 |
|
|---|
| 376 | b.Property<string>("Content")
|
|---|
| 377 | .HasColumnType("text");
|
|---|
| 378 |
|
|---|
| 379 | b.Property<DateTime>("CreatedAt")
|
|---|
| 380 | .HasColumnType("timestamp with time zone");
|
|---|
| 381 |
|
|---|
| 382 | b.Property<bool>("IsPublic")
|
|---|
| 383 | .HasColumnType("boolean");
|
|---|
| 384 |
|
|---|
| 385 | b.Property<string>("Name")
|
|---|
| 386 | .IsRequired()
|
|---|
| 387 | .HasColumnType("text");
|
|---|
| 388 |
|
|---|
| 389 | b.Property<DateTime>("UpdatedAt")
|
|---|
| 390 | .HasColumnType("timestamp with time zone");
|
|---|
| 391 |
|
|---|
| 392 | b.Property<int>("UserId")
|
|---|
| 393 | .HasColumnType("integer");
|
|---|
| 394 |
|
|---|
| 395 | b.HasKey("Id");
|
|---|
| 396 |
|
|---|
| 397 | b.HasIndex("UserId");
|
|---|
| 398 |
|
|---|
| 399 | b.ToTable("ReadingLists");
|
|---|
| 400 | });
|
|---|
| 401 |
|
|---|
| 402 | modelBuilder.Entity("ChapterX.Domain.Entities.ReadingListItems", b =>
|
|---|
| 403 | {
|
|---|
| 404 | b.Property<int>("Id")
|
|---|
| 405 | .ValueGeneratedOnAdd()
|
|---|
| 406 | .HasColumnType("integer");
|
|---|
| 407 |
|
|---|
| 408 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 409 |
|
|---|
| 410 | b.Property<DateTime>("AddedAt")
|
|---|
| 411 | .HasColumnType("timestamp with time zone");
|
|---|
| 412 |
|
|---|
| 413 | b.Property<int>("ReadingListId")
|
|---|
| 414 | .HasColumnType("integer");
|
|---|
| 415 |
|
|---|
| 416 | b.Property<int>("StoryId")
|
|---|
| 417 | .HasColumnType("integer");
|
|---|
| 418 |
|
|---|
| 419 | b.HasKey("Id");
|
|---|
| 420 |
|
|---|
| 421 | b.HasIndex("ReadingListId");
|
|---|
| 422 |
|
|---|
| 423 | b.HasIndex("StoryId");
|
|---|
| 424 |
|
|---|
| 425 | b.ToTable("ReadingListItems");
|
|---|
| 426 | });
|
|---|
| 427 |
|
|---|
| 428 | modelBuilder.Entity("ChapterX.Domain.Entities.RegularUser", b =>
|
|---|
| 429 | {
|
|---|
| 430 | b.Property<int>("Id")
|
|---|
| 431 | .ValueGeneratedOnAdd()
|
|---|
| 432 | .HasColumnType("integer");
|
|---|
| 433 |
|
|---|
| 434 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 435 |
|
|---|
| 436 | b.Property<int>("UserId")
|
|---|
| 437 | .HasColumnType("integer");
|
|---|
| 438 |
|
|---|
| 439 | b.HasKey("Id");
|
|---|
| 440 |
|
|---|
| 441 | b.HasIndex("UserId")
|
|---|
| 442 | .IsUnique();
|
|---|
| 443 |
|
|---|
| 444 | b.ToTable("RegularUsers");
|
|---|
| 445 | });
|
|---|
| 446 |
|
|---|
| 447 | modelBuilder.Entity("ChapterX.Domain.Entities.Story", b =>
|
|---|
| 448 | {
|
|---|
| 449 | b.Property<int>("Id")
|
|---|
| 450 | .ValueGeneratedOnAdd()
|
|---|
| 451 | .HasColumnType("integer");
|
|---|
| 452 |
|
|---|
| 453 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 454 |
|
|---|
| 455 | b.Property<string>("Content")
|
|---|
| 456 | .IsRequired()
|
|---|
| 457 | .HasColumnType("text");
|
|---|
| 458 |
|
|---|
| 459 | b.Property<DateTime>("CreatedAt")
|
|---|
| 460 | .HasColumnType("timestamp with time zone");
|
|---|
| 461 |
|
|---|
| 462 | b.Property<string>("Image")
|
|---|
| 463 | .HasColumnType("text");
|
|---|
| 464 |
|
|---|
| 465 | b.Property<bool>("MatureContent")
|
|---|
| 466 | .HasColumnType("boolean");
|
|---|
| 467 |
|
|---|
| 468 | b.Property<string>("ShortDescription")
|
|---|
| 469 | .IsRequired()
|
|---|
| 470 | .HasColumnType("text");
|
|---|
| 471 |
|
|---|
| 472 | b.PrimitiveCollection<int[]>("Statuses")
|
|---|
| 473 | .IsRequired()
|
|---|
| 474 | .HasColumnType("integer[]");
|
|---|
| 475 |
|
|---|
| 476 | b.Property<DateTime>("UpdatedAt")
|
|---|
| 477 | .HasColumnType("timestamp with time zone");
|
|---|
| 478 |
|
|---|
| 479 | b.Property<int>("UserId")
|
|---|
| 480 | .HasColumnType("integer");
|
|---|
| 481 |
|
|---|
| 482 | b.Property<int>("WriterId")
|
|---|
| 483 | .HasColumnType("integer");
|
|---|
| 484 |
|
|---|
| 485 | b.HasKey("Id");
|
|---|
| 486 |
|
|---|
| 487 | b.HasIndex("WriterId");
|
|---|
| 488 |
|
|---|
| 489 | b.ToTable("Stories");
|
|---|
| 490 | });
|
|---|
| 491 |
|
|---|
| 492 | modelBuilder.Entity("ChapterX.Domain.Entities.User", b =>
|
|---|
| 493 | {
|
|---|
| 494 | b.Property<int>("Id")
|
|---|
| 495 | .ValueGeneratedOnAdd()
|
|---|
| 496 | .HasColumnType("integer");
|
|---|
| 497 |
|
|---|
| 498 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 499 |
|
|---|
| 500 | b.Property<DateTime>("CreatedAt")
|
|---|
| 501 | .HasColumnType("timestamp with time zone");
|
|---|
| 502 |
|
|---|
| 503 | b.Property<string>("Email")
|
|---|
| 504 | .IsRequired()
|
|---|
| 505 | .HasColumnType("text");
|
|---|
| 506 |
|
|---|
| 507 | b.Property<string>("Name")
|
|---|
| 508 | .IsRequired()
|
|---|
| 509 | .HasColumnType("text");
|
|---|
| 510 |
|
|---|
| 511 | b.Property<string>("Password")
|
|---|
| 512 | .IsRequired()
|
|---|
| 513 | .HasColumnType("text");
|
|---|
| 514 |
|
|---|
| 515 | b.Property<string>("Surname")
|
|---|
| 516 | .IsRequired()
|
|---|
| 517 | .HasColumnType("text");
|
|---|
| 518 |
|
|---|
| 519 | b.Property<DateTime>("UpdatedAt")
|
|---|
| 520 | .HasColumnType("timestamp with time zone");
|
|---|
| 521 |
|
|---|
| 522 | b.Property<string>("Username")
|
|---|
| 523 | .IsRequired()
|
|---|
| 524 | .HasColumnType("text");
|
|---|
| 525 |
|
|---|
| 526 | b.HasKey("Id");
|
|---|
| 527 |
|
|---|
| 528 | b.ToTable("Users");
|
|---|
| 529 | });
|
|---|
| 530 |
|
|---|
| 531 | modelBuilder.Entity("ChapterX.Domain.Entities.Writer", b =>
|
|---|
| 532 | {
|
|---|
| 533 | b.Property<int>("Id")
|
|---|
| 534 | .ValueGeneratedOnAdd()
|
|---|
| 535 | .HasColumnType("integer");
|
|---|
| 536 |
|
|---|
| 537 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|---|
| 538 |
|
|---|
| 539 | b.Property<string>("Bio")
|
|---|
| 540 | .IsRequired()
|
|---|
| 541 | .HasColumnType("text");
|
|---|
| 542 |
|
|---|
| 543 | b.Property<int>("UserId")
|
|---|
| 544 | .HasColumnType("integer");
|
|---|
| 545 |
|
|---|
| 546 | b.HasKey("Id");
|
|---|
| 547 |
|
|---|
| 548 | b.HasIndex("UserId")
|
|---|
| 549 | .IsUnique();
|
|---|
| 550 |
|
|---|
| 551 | b.ToTable("Writers");
|
|---|
| 552 | });
|
|---|
| 553 |
|
|---|
| 554 | modelBuilder.Entity("ChapterX.Domain.Entities.AISuggestion", b =>
|
|---|
| 555 | {
|
|---|
| 556 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 557 | .WithMany("AISuggestions")
|
|---|
| 558 | .HasForeignKey("StoryId")
|
|---|
| 559 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 560 | .IsRequired();
|
|---|
| 561 |
|
|---|
| 562 | b.Navigation("Story");
|
|---|
| 563 | });
|
|---|
| 564 |
|
|---|
| 565 | modelBuilder.Entity("ChapterX.Domain.Entities.Admin", b =>
|
|---|
| 566 | {
|
|---|
| 567 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 568 | .WithOne("Admin")
|
|---|
| 569 | .HasForeignKey("ChapterX.Domain.Entities.Admin", "UserId")
|
|---|
| 570 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 571 | .IsRequired();
|
|---|
| 572 |
|
|---|
| 573 | b.Navigation("User");
|
|---|
| 574 | });
|
|---|
| 575 |
|
|---|
| 576 | modelBuilder.Entity("ChapterX.Domain.Entities.Chapter", b =>
|
|---|
| 577 | {
|
|---|
| 578 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 579 | .WithMany("Chapters")
|
|---|
| 580 | .HasForeignKey("StoryId")
|
|---|
| 581 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 582 | .IsRequired();
|
|---|
| 583 |
|
|---|
| 584 | b.Navigation("Story");
|
|---|
| 585 | });
|
|---|
| 586 |
|
|---|
| 587 | modelBuilder.Entity("ChapterX.Domain.Entities.Collaboration", b =>
|
|---|
| 588 | {
|
|---|
| 589 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 590 | .WithMany("Collaborations")
|
|---|
| 591 | .HasForeignKey("StoryId")
|
|---|
| 592 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 593 | .IsRequired();
|
|---|
| 594 |
|
|---|
| 595 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 596 | .WithMany("Collaborations")
|
|---|
| 597 | .HasForeignKey("UserId")
|
|---|
| 598 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 599 | .IsRequired();
|
|---|
| 600 |
|
|---|
| 601 | b.Navigation("Story");
|
|---|
| 602 |
|
|---|
| 603 | b.Navigation("User");
|
|---|
| 604 | });
|
|---|
| 605 |
|
|---|
| 606 | modelBuilder.Entity("ChapterX.Domain.Entities.Comment", b =>
|
|---|
| 607 | {
|
|---|
| 608 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 609 | .WithMany("Comments")
|
|---|
| 610 | .HasForeignKey("StoryId")
|
|---|
| 611 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 612 | .IsRequired();
|
|---|
| 613 |
|
|---|
| 614 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 615 | .WithMany("Comments")
|
|---|
| 616 | .HasForeignKey("UserId")
|
|---|
| 617 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 618 | .IsRequired();
|
|---|
| 619 |
|
|---|
| 620 | b.Navigation("Story");
|
|---|
| 621 |
|
|---|
| 622 | b.Navigation("User");
|
|---|
| 623 | });
|
|---|
| 624 |
|
|---|
| 625 | modelBuilder.Entity("ChapterX.Domain.Entities.HasGenre", b =>
|
|---|
| 626 | {
|
|---|
| 627 | b.HasOne("ChapterX.Domain.Entities.Genre", "Genre")
|
|---|
| 628 | .WithMany("HasGenres")
|
|---|
| 629 | .HasForeignKey("GenreId")
|
|---|
| 630 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 631 | .IsRequired();
|
|---|
| 632 |
|
|---|
| 633 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 634 | .WithMany("HasGenres")
|
|---|
| 635 | .HasForeignKey("StoryId")
|
|---|
| 636 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 637 | .IsRequired();
|
|---|
| 638 |
|
|---|
| 639 | b.Navigation("Genre");
|
|---|
| 640 |
|
|---|
| 641 | b.Navigation("Story");
|
|---|
| 642 | });
|
|---|
| 643 |
|
|---|
| 644 | modelBuilder.Entity("ChapterX.Domain.Entities.Likes", b =>
|
|---|
| 645 | {
|
|---|
| 646 | b.HasOne("ChapterX.Domain.Entities.Chapter", "Chapter")
|
|---|
| 647 | .WithMany()
|
|---|
| 648 | .HasForeignKey("ChapterId")
|
|---|
| 649 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 650 | .IsRequired();
|
|---|
| 651 |
|
|---|
| 652 | b.HasOne("ChapterX.Domain.Entities.Story", null)
|
|---|
| 653 | .WithMany("Likes")
|
|---|
| 654 | .HasForeignKey("StoryId");
|
|---|
| 655 |
|
|---|
| 656 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 657 | .WithMany("Likes")
|
|---|
| 658 | .HasForeignKey("UserId")
|
|---|
| 659 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 660 | .IsRequired();
|
|---|
| 661 |
|
|---|
| 662 | b.Navigation("Chapter");
|
|---|
| 663 |
|
|---|
| 664 | b.Navigation("User");
|
|---|
| 665 | });
|
|---|
| 666 |
|
|---|
| 667 | modelBuilder.Entity("ChapterX.Domain.Entities.NeedApproval", b =>
|
|---|
| 668 | {
|
|---|
| 669 | b.HasOne("ChapterX.Domain.Entities.AISuggestion", null)
|
|---|
| 670 | .WithMany("NeedApprovals")
|
|---|
| 671 | .HasForeignKey("AISuggestionId");
|
|---|
| 672 |
|
|---|
| 673 | b.HasOne("ChapterX.Domain.Entities.Admin", "Admin")
|
|---|
| 674 | .WithMany()
|
|---|
| 675 | .HasForeignKey("AdminId")
|
|---|
| 676 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 677 | .IsRequired();
|
|---|
| 678 |
|
|---|
| 679 | b.HasOne("ChapterX.Domain.Entities.Chapter", null)
|
|---|
| 680 | .WithMany("NeedApprovals")
|
|---|
| 681 | .HasForeignKey("ChapterId");
|
|---|
| 682 |
|
|---|
| 683 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 684 | .WithMany("NeedApprovals")
|
|---|
| 685 | .HasForeignKey("StoryId")
|
|---|
| 686 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 687 | .IsRequired();
|
|---|
| 688 |
|
|---|
| 689 | b.Navigation("Admin");
|
|---|
| 690 |
|
|---|
| 691 | b.Navigation("Story");
|
|---|
| 692 | });
|
|---|
| 693 |
|
|---|
| 694 | modelBuilder.Entity("ChapterX.Domain.Entities.Notify", b =>
|
|---|
| 695 | {
|
|---|
| 696 | b.HasOne("ChapterX.Domain.Entities.Notification", "Notification")
|
|---|
| 697 | .WithMany("Notifies")
|
|---|
| 698 | .HasForeignKey("NotificationId")
|
|---|
| 699 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 700 | .IsRequired();
|
|---|
| 701 |
|
|---|
| 702 | b.HasOne("ChapterX.Domain.Entities.Story", null)
|
|---|
| 703 | .WithMany("Notifies")
|
|---|
| 704 | .HasForeignKey("StoryId");
|
|---|
| 705 |
|
|---|
| 706 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 707 | .WithMany("Notifies")
|
|---|
| 708 | .HasForeignKey("UserId")
|
|---|
| 709 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 710 | .IsRequired();
|
|---|
| 711 |
|
|---|
| 712 | b.Navigation("Notification");
|
|---|
| 713 |
|
|---|
| 714 | b.Navigation("User");
|
|---|
| 715 | });
|
|---|
| 716 |
|
|---|
| 717 | modelBuilder.Entity("ChapterX.Domain.Entities.ReadingList", b =>
|
|---|
| 718 | {
|
|---|
| 719 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 720 | .WithMany("ReadingLists")
|
|---|
| 721 | .HasForeignKey("UserId")
|
|---|
| 722 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 723 | .IsRequired();
|
|---|
| 724 |
|
|---|
| 725 | b.Navigation("User");
|
|---|
| 726 | });
|
|---|
| 727 |
|
|---|
| 728 | modelBuilder.Entity("ChapterX.Domain.Entities.ReadingListItems", b =>
|
|---|
| 729 | {
|
|---|
| 730 | b.HasOne("ChapterX.Domain.Entities.ReadingList", "ReadingList")
|
|---|
| 731 | .WithMany("ReadingListItems")
|
|---|
| 732 | .HasForeignKey("ReadingListId")
|
|---|
| 733 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 734 | .IsRequired();
|
|---|
| 735 |
|
|---|
| 736 | b.HasOne("ChapterX.Domain.Entities.Story", "Story")
|
|---|
| 737 | .WithMany("ReadingListItems")
|
|---|
| 738 | .HasForeignKey("StoryId")
|
|---|
| 739 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 740 | .IsRequired();
|
|---|
| 741 |
|
|---|
| 742 | b.Navigation("ReadingList");
|
|---|
| 743 |
|
|---|
| 744 | b.Navigation("Story");
|
|---|
| 745 | });
|
|---|
| 746 |
|
|---|
| 747 | modelBuilder.Entity("ChapterX.Domain.Entities.RegularUser", b =>
|
|---|
| 748 | {
|
|---|
| 749 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 750 | .WithOne("RegularUser")
|
|---|
| 751 | .HasForeignKey("ChapterX.Domain.Entities.RegularUser", "UserId")
|
|---|
| 752 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 753 | .IsRequired();
|
|---|
| 754 |
|
|---|
| 755 | b.Navigation("User");
|
|---|
| 756 | });
|
|---|
| 757 |
|
|---|
| 758 | modelBuilder.Entity("ChapterX.Domain.Entities.Story", b =>
|
|---|
| 759 | {
|
|---|
| 760 | b.HasOne("ChapterX.Domain.Entities.Writer", "Writer")
|
|---|
| 761 | .WithMany("Stories")
|
|---|
| 762 | .HasForeignKey("WriterId")
|
|---|
| 763 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 764 | .IsRequired();
|
|---|
| 765 |
|
|---|
| 766 | b.Navigation("Writer");
|
|---|
| 767 | });
|
|---|
| 768 |
|
|---|
| 769 | modelBuilder.Entity("ChapterX.Domain.Entities.Writer", b =>
|
|---|
| 770 | {
|
|---|
| 771 | b.HasOne("ChapterX.Domain.Entities.User", "User")
|
|---|
| 772 | .WithOne("Writer")
|
|---|
| 773 | .HasForeignKey("ChapterX.Domain.Entities.Writer", "UserId")
|
|---|
| 774 | .OnDelete(DeleteBehavior.Cascade)
|
|---|
| 775 | .IsRequired();
|
|---|
| 776 |
|
|---|
| 777 | b.Navigation("User");
|
|---|
| 778 | });
|
|---|
| 779 |
|
|---|
| 780 | modelBuilder.Entity("ChapterX.Domain.Entities.AISuggestion", b =>
|
|---|
| 781 | {
|
|---|
| 782 | b.Navigation("NeedApprovals");
|
|---|
| 783 | });
|
|---|
| 784 |
|
|---|
| 785 | modelBuilder.Entity("ChapterX.Domain.Entities.Chapter", b =>
|
|---|
| 786 | {
|
|---|
| 787 | b.Navigation("NeedApprovals");
|
|---|
| 788 | });
|
|---|
| 789 |
|
|---|
| 790 | modelBuilder.Entity("ChapterX.Domain.Entities.Genre", b =>
|
|---|
| 791 | {
|
|---|
| 792 | b.Navigation("HasGenres");
|
|---|
| 793 | });
|
|---|
| 794 |
|
|---|
| 795 | modelBuilder.Entity("ChapterX.Domain.Entities.Notification", b =>
|
|---|
| 796 | {
|
|---|
| 797 | b.Navigation("Notifies");
|
|---|
| 798 | });
|
|---|
| 799 |
|
|---|
| 800 | modelBuilder.Entity("ChapterX.Domain.Entities.ReadingList", b =>
|
|---|
| 801 | {
|
|---|
| 802 | b.Navigation("ReadingListItems");
|
|---|
| 803 | });
|
|---|
| 804 |
|
|---|
| 805 | modelBuilder.Entity("ChapterX.Domain.Entities.Story", b =>
|
|---|
| 806 | {
|
|---|
| 807 | b.Navigation("AISuggestions");
|
|---|
| 808 |
|
|---|
| 809 | b.Navigation("Chapters");
|
|---|
| 810 |
|
|---|
| 811 | b.Navigation("Collaborations");
|
|---|
| 812 |
|
|---|
| 813 | b.Navigation("Comments");
|
|---|
| 814 |
|
|---|
| 815 | b.Navigation("HasGenres");
|
|---|
| 816 |
|
|---|
| 817 | b.Navigation("Likes");
|
|---|
| 818 |
|
|---|
| 819 | b.Navigation("NeedApprovals");
|
|---|
| 820 |
|
|---|
| 821 | b.Navigation("Notifies");
|
|---|
| 822 |
|
|---|
| 823 | b.Navigation("ReadingListItems");
|
|---|
| 824 | });
|
|---|
| 825 |
|
|---|
| 826 | modelBuilder.Entity("ChapterX.Domain.Entities.User", b =>
|
|---|
| 827 | {
|
|---|
| 828 | b.Navigation("Admin");
|
|---|
| 829 |
|
|---|
| 830 | b.Navigation("Collaborations");
|
|---|
| 831 |
|
|---|
| 832 | b.Navigation("Comments");
|
|---|
| 833 |
|
|---|
| 834 | b.Navigation("Likes");
|
|---|
| 835 |
|
|---|
| 836 | b.Navigation("Notifies");
|
|---|
| 837 |
|
|---|
| 838 | b.Navigation("ReadingLists");
|
|---|
| 839 |
|
|---|
| 840 | b.Navigation("RegularUser");
|
|---|
| 841 |
|
|---|
| 842 | b.Navigation("Writer");
|
|---|
| 843 | });
|
|---|
| 844 |
|
|---|
| 845 | modelBuilder.Entity("ChapterX.Domain.Entities.Writer", b =>
|
|---|
| 846 | {
|
|---|
| 847 | b.Navigation("Stories");
|
|---|
| 848 | });
|
|---|
| 849 | #pragma warning restore 612, 618
|
|---|
| 850 | }
|
|---|
| 851 | }
|
|---|
| 852 | }
|
|---|