source: iknow-api/Migrations/20251029131316_InitialCreate.Designer.cs@ f8af32b

Last change on this file since f8af32b was f8af32b, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

Add EMBG property and consolidate migrations

Added EMBG property to User and RegisterDto classes to store unique user identifiers. Removed outdated migration files and introduced a new consolidated migration (20251029131316_InitialCreate) to define the database schema, including User, ContactInfo, EnrollmentInfo, HighSchool, and RefreshToken tables with appropriate relationships. Updated AppDbContextModelSnapshot to reflect the new schema. Changed the development database connection string in appsettings.Development.json for improved configuration.

  • Property mode set to 100644
File size: 7.6 KB
Line 
1// <auto-generated />
2using System;
3using Microsoft.EntityFrameworkCore;
4using Microsoft.EntityFrameworkCore.Infrastructure;
5using Microsoft.EntityFrameworkCore.Migrations;
6using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
8using iknow_api.Data;
9
10#nullable disable
11
12namespace iknow_api.Migrations
13{
14 [DbContext(typeof(AppDbContext))]
15 [Migration("20251029131316_InitialCreate")]
16 partial class InitialCreate
17 {
18 /// <inheritdoc />
19 protected override void BuildTargetModel(ModelBuilder modelBuilder)
20 {
21#pragma warning disable 612, 618
22 modelBuilder
23 .HasAnnotation("ProductVersion", "9.0.10")
24 .HasAnnotation("Relational:MaxIdentifierLength", 63);
25
26 NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
27
28 modelBuilder.Entity("iknow_api.Models.ContactInfo", b =>
29 {
30 b.Property<int>("Id")
31 .ValueGeneratedOnAdd()
32 .HasColumnType("integer");
33
34 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
35
36 b.Property<int>("UserId")
37 .HasColumnType("integer");
38
39 b.Property<string>("address")
40 .HasColumnType("text");
41
42 b.Property<string>("city")
43 .HasColumnType("text");
44
45 b.Property<string>("microsoftEmail")
46 .HasColumnType("text");
47
48 b.Property<string>("municipality")
49 .HasColumnType("text");
50
51 b.Property<string>("phoneNumber")
52 .HasColumnType("text");
53
54 b.HasKey("Id");
55
56 b.HasIndex("UserId")
57 .IsUnique();
58
59 b.ToTable("ContactInfo");
60 });
61
62 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b =>
63 {
64 b.Property<int>("Id")
65 .ValueGeneratedOnAdd()
66 .HasColumnType("integer");
67
68 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
69
70 b.Property<int>("UserId")
71 .HasColumnType("integer");
72
73 b.Property<int>("enrollmentYear")
74 .HasColumnType("integer");
75
76 b.Property<int>("major")
77 .HasColumnType("integer");
78
79 b.HasKey("Id");
80
81 b.HasIndex("UserId")
82 .IsUnique();
83
84 b.ToTable("EnrollmentInfo");
85 });
86
87 modelBuilder.Entity("iknow_api.Models.HighSchool", b =>
88 {
89 b.Property<int>("Id")
90 .ValueGeneratedOnAdd()
91 .HasColumnType("integer");
92
93 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
94
95 b.Property<float>("GPA")
96 .HasColumnType("real");
97
98 b.Property<int>("UserId")
99 .HasColumnType("integer");
100
101 b.Property<int>("tip")
102 .HasColumnType("integer");
103
104 b.HasKey("Id");
105
106 b.HasIndex("UserId")
107 .IsUnique();
108
109 b.ToTable("HighSchool");
110 });
111
112 modelBuilder.Entity("iknow_api.Models.RefreshToken", b =>
113 {
114 b.Property<int>("Id")
115 .ValueGeneratedOnAdd()
116 .HasColumnType("integer");
117
118 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
119
120 b.Property<DateTime>("ExpiresAt")
121 .HasColumnType("timestamp with time zone");
122
123 b.Property<bool>("IsValid")
124 .HasColumnType("boolean");
125
126 b.Property<string>("Token")
127 .HasColumnType("text");
128
129 b.Property<int>("UserId")
130 .HasColumnType("integer");
131
132 b.HasKey("Id");
133
134 b.HasIndex("UserId");
135
136 b.ToTable("RefreshToken");
137 });
138
139 modelBuilder.Entity("iknow_api.Models.User", b =>
140 {
141 b.Property<int>("Id")
142 .ValueGeneratedOnAdd()
143 .HasColumnType("integer");
144
145 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
146
147 b.Property<DateTime>("Bday")
148 .HasColumnType("timestamp with time zone");
149
150 b.Property<DateTime>("CreatedAt")
151 .HasColumnType("timestamp with time zone");
152
153 b.Property<string>("Email")
154 .HasColumnType("text");
155
156 b.Property<string>("Index")
157 .HasColumnType("text");
158
159 b.Property<string>("Name")
160 .HasColumnType("text");
161
162 b.Property<string>("PasswordHash")
163 .HasColumnType("text");
164
165 b.Property<int>("Role")
166 .HasColumnType("integer");
167
168 b.Property<string>("Surname")
169 .HasColumnType("text");
170
171 b.HasKey("Id");
172
173 b.ToTable("User");
174 });
175
176 modelBuilder.Entity("iknow_api.Models.ContactInfo", b =>
177 {
178 b.HasOne("iknow_api.Models.User", "User")
179 .WithOne("ContactInfo")
180 .HasForeignKey("iknow_api.Models.ContactInfo", "UserId")
181 .OnDelete(DeleteBehavior.Cascade)
182 .IsRequired();
183
184 b.Navigation("User");
185 });
186
187 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b =>
188 {
189 b.HasOne("iknow_api.Models.User", "User")
190 .WithOne("EnrollmentInfo")
191 .HasForeignKey("iknow_api.Models.EnrollmentInfo", "UserId")
192 .OnDelete(DeleteBehavior.Cascade)
193 .IsRequired();
194
195 b.Navigation("User");
196 });
197
198 modelBuilder.Entity("iknow_api.Models.HighSchool", b =>
199 {
200 b.HasOne("iknow_api.Models.User", "User")
201 .WithOne("HighSchool")
202 .HasForeignKey("iknow_api.Models.HighSchool", "UserId")
203 .OnDelete(DeleteBehavior.Cascade)
204 .IsRequired();
205
206 b.Navigation("User");
207 });
208
209 modelBuilder.Entity("iknow_api.Models.RefreshToken", b =>
210 {
211 b.HasOne("iknow_api.Models.User", "User")
212 .WithMany()
213 .HasForeignKey("UserId")
214 .OnDelete(DeleteBehavior.Cascade)
215 .IsRequired();
216
217 b.Navigation("User");
218 });
219
220 modelBuilder.Entity("iknow_api.Models.User", b =>
221 {
222 b.Navigation("ContactInfo");
223
224 b.Navigation("EnrollmentInfo");
225
226 b.Navigation("HighSchool");
227 });
228#pragma warning restore 612, 618
229 }
230 }
231}
Note: See TracBrowser for help on using the repository browser.