AppDbContextModelSnapshot.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // <auto-generated />
  2. using System;
  3. using AvaloniaApplication2.Models;
  4. using Microsoft.EntityFrameworkCore;
  5. using Microsoft.EntityFrameworkCore.Infrastructure;
  6. using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
  7. using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
  8. #nullable disable
  9. namespace AvaloniaPractic.Migrations
  10. {
  11. [DbContext(typeof(AppDbContext))]
  12. partial class AppDbContextModelSnapshot : ModelSnapshot
  13. {
  14. protected override void BuildModel(ModelBuilder modelBuilder)
  15. {
  16. #pragma warning disable 612, 618
  17. modelBuilder
  18. .HasAnnotation("ProductVersion", "8.0.8")
  19. .HasAnnotation("Relational:MaxIdentifierLength", 63);
  20. NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
  21. modelBuilder.Entity("AvaloniaApplication2.Models.User", b =>
  22. {
  23. b.Property<int>("Id")
  24. .ValueGeneratedOnAdd()
  25. .HasColumnType("integer")
  26. .HasColumnName("id");
  27. NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
  28. b.Property<DateTime?>("Createdat")
  29. .ValueGeneratedOnAdd()
  30. .HasColumnType("timestamp without time zone")
  31. .HasColumnName("createdat")
  32. .HasDefaultValueSql("CURRENT_TIMESTAMP");
  33. b.Property<string>("Email")
  34. .IsRequired()
  35. .HasMaxLength(255)
  36. .HasColumnType("character varying(255)")
  37. .HasColumnName("email");
  38. b.Property<string>("Username")
  39. .IsRequired()
  40. .HasMaxLength(100)
  41. .HasColumnType("character varying(100)")
  42. .HasColumnName("username");
  43. b.HasKey("Id")
  44. .HasName("users_pkey");
  45. b.ToTable("users", (string)null);
  46. });
  47. modelBuilder.Entity("AvaloniaPractic.Models.Logined", b =>
  48. {
  49. b.Property<int>("Id")
  50. .ValueGeneratedOnAdd()
  51. .HasColumnType("integer");
  52. NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
  53. b.Property<string>("Login")
  54. .IsRequired()
  55. .HasColumnType("text");
  56. b.Property<string>("Password")
  57. .IsRequired()
  58. .HasColumnType("text");
  59. b.Property<int>("RoleId")
  60. .HasColumnType("integer");
  61. b.Property<int>("UserId")
  62. .HasColumnType("integer");
  63. b.HasKey("Id");
  64. b.HasIndex("RoleId");
  65. b.HasIndex("UserId");
  66. b.ToTable("Logins");
  67. });
  68. modelBuilder.Entity("AvaloniaPractic.Models.Role", b =>
  69. {
  70. b.Property<int>("Id")
  71. .ValueGeneratedOnAdd()
  72. .HasColumnType("integer");
  73. NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
  74. b.Property<string>("Name")
  75. .IsRequired()
  76. .HasColumnType("text");
  77. b.HasKey("Id");
  78. b.ToTable("Roles");
  79. });
  80. modelBuilder.Entity("AvaloniaPractic.Models.Logined", b =>
  81. {
  82. b.HasOne("AvaloniaPractic.Models.Role", "Role")
  83. .WithMany("Logins")
  84. .HasForeignKey("RoleId")
  85. .OnDelete(DeleteBehavior.Cascade)
  86. .IsRequired();
  87. b.HasOne("AvaloniaApplication2.Models.User", "User")
  88. .WithMany("Logins")
  89. .HasForeignKey("UserId")
  90. .OnDelete(DeleteBehavior.Cascade)
  91. .IsRequired();
  92. b.Navigation("Role");
  93. b.Navigation("User");
  94. });
  95. modelBuilder.Entity("AvaloniaApplication2.Models.User", b =>
  96. {
  97. b.Navigation("Logins");
  98. });
  99. modelBuilder.Entity("AvaloniaPractic.Models.Role", b =>
  100. {
  101. b.Navigation("Logins");
  102. });
  103. #pragma warning restore 612, 618
  104. }
  105. }
  106. }