20241010095341_UpdateUsersAndLoginedTables.Designer.cs 4.8 KB

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