[a8ccc2c] | 1 | // <auto-generated />
|
---|
| 2 | using System;
|
---|
| 3 | using FarmatikoData;
|
---|
| 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 | namespace FarmatikoData.Migrations
|
---|
| 11 | {
|
---|
| 12 | [DbContext(typeof(FarmatikoDataContext))]
|
---|
[1db5673] | 13 | [Migration("20201111183247_InitialMigration")]
|
---|
[d23bf72] | 14 | partial class InitialMigration
|
---|
[a8ccc2c] | 15 | {
|
---|
| 16 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
---|
| 17 | {
|
---|
| 18 | #pragma warning disable 612, 618
|
---|
| 19 | modelBuilder
|
---|
| 20 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
---|
| 21 | .HasAnnotation("ProductVersion", "3.1.6")
|
---|
| 22 | .HasAnnotation("Relational:MaxIdentifierLength", 63);
|
---|
| 23 |
|
---|
[d23bf72] | 24 | modelBuilder.Entity("FarmatikoData.Models.HealthFacility", b =>
|
---|
[a8ccc2c] | 25 | {
|
---|
| 26 | b.Property<int>("Id")
|
---|
| 27 | .ValueGeneratedOnAdd()
|
---|
| 28 | .HasColumnType("integer")
|
---|
| 29 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 30 |
|
---|
| 31 | b.Property<string>("Address")
|
---|
| 32 | .IsRequired()
|
---|
| 33 | .HasColumnType("text");
|
---|
| 34 |
|
---|
| 35 | b.Property<DateTime>("CreatedOn")
|
---|
| 36 | .HasColumnType("timestamp without time zone");
|
---|
| 37 |
|
---|
[d23bf72] | 38 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 39 | .HasColumnType("timestamp without time zone");
|
---|
| 40 |
|
---|
| 41 | b.Property<string>("Email")
|
---|
| 42 | .HasColumnType("text");
|
---|
| 43 |
|
---|
| 44 | b.Property<string>("Municipality")
|
---|
| 45 | .IsRequired()
|
---|
| 46 | .HasColumnType("text");
|
---|
| 47 |
|
---|
| 48 | b.Property<string>("Name")
|
---|
| 49 | .IsRequired()
|
---|
| 50 | .HasColumnType("text");
|
---|
| 51 |
|
---|
| 52 | b.Property<string>("Phone")
|
---|
| 53 | .HasColumnType("text");
|
---|
| 54 |
|
---|
| 55 | b.Property<string>("Type")
|
---|
| 56 | .IsRequired()
|
---|
| 57 | .HasColumnType("text");
|
---|
| 58 |
|
---|
| 59 | b.HasKey("Id");
|
---|
| 60 |
|
---|
| 61 | b.ToTable("HealthFacilities");
|
---|
| 62 | });
|
---|
| 63 |
|
---|
[d23bf72] | 64 | modelBuilder.Entity("FarmatikoData.Models.HealthcareWorker", b =>
|
---|
[a8ccc2c] | 65 | {
|
---|
| 66 | b.Property<int>("Id")
|
---|
| 67 | .ValueGeneratedOnAdd()
|
---|
| 68 | .HasColumnType("integer")
|
---|
| 69 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 70 |
|
---|
| 71 | b.Property<string>("Branch")
|
---|
| 72 | .IsRequired()
|
---|
| 73 | .HasColumnType("text");
|
---|
| 74 |
|
---|
| 75 | b.Property<DateTime>("CreatedOn")
|
---|
| 76 | .HasColumnType("timestamp without time zone");
|
---|
| 77 |
|
---|
[d23bf72] | 78 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 79 | .HasColumnType("timestamp without time zone");
|
---|
| 80 |
|
---|
| 81 | b.Property<int>("FacilityId")
|
---|
| 82 | .HasColumnType("integer");
|
---|
| 83 |
|
---|
| 84 | b.Property<string>("Name")
|
---|
| 85 | .IsRequired()
|
---|
| 86 | .HasColumnType("text");
|
---|
| 87 |
|
---|
| 88 | b.Property<string>("Title")
|
---|
| 89 | .HasColumnType("text");
|
---|
| 90 |
|
---|
| 91 | b.HasKey("Id");
|
---|
| 92 |
|
---|
| 93 | b.HasIndex("FacilityId");
|
---|
| 94 |
|
---|
| 95 | b.ToTable("HealthcareWorkers");
|
---|
| 96 | });
|
---|
| 97 |
|
---|
| 98 | modelBuilder.Entity("FarmatikoData.Models.Medicine", b =>
|
---|
| 99 | {
|
---|
| 100 | b.Property<int>("Id")
|
---|
| 101 | .ValueGeneratedOnAdd()
|
---|
| 102 | .HasColumnType("integer")
|
---|
| 103 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 104 |
|
---|
| 105 | b.Property<DateTime>("CreatedOn")
|
---|
| 106 | .HasColumnType("timestamp without time zone");
|
---|
| 107 |
|
---|
[d23bf72] | 108 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 109 | .HasColumnType("timestamp without time zone");
|
---|
| 110 |
|
---|
| 111 | b.Property<string>("Form")
|
---|
| 112 | .HasColumnType("text");
|
---|
| 113 |
|
---|
| 114 | b.Property<string>("Manufacturer")
|
---|
[d23bf72] | 115 | .IsRequired()
|
---|
[a8ccc2c] | 116 | .HasColumnType("text");
|
---|
| 117 |
|
---|
| 118 | b.Property<string>("Name")
|
---|
[d23bf72] | 119 | .IsRequired()
|
---|
[a8ccc2c] | 120 | .HasColumnType("text");
|
---|
| 121 |
|
---|
| 122 | b.Property<string>("Packaging")
|
---|
| 123 | .HasColumnType("text");
|
---|
| 124 |
|
---|
[1db5673] | 125 | b.Property<int?>("PharmacyHeadId")
|
---|
| 126 | .HasColumnType("integer");
|
---|
| 127 |
|
---|
[a8ccc2c] | 128 | b.Property<float>("Price")
|
---|
| 129 | .HasColumnType("real");
|
---|
| 130 |
|
---|
| 131 | b.Property<string>("Strength")
|
---|
[d23bf72] | 132 | .IsRequired()
|
---|
[a8ccc2c] | 133 | .HasColumnType("text");
|
---|
| 134 |
|
---|
| 135 | b.Property<string>("WayOfIssuing")
|
---|
[d23bf72] | 136 | .IsRequired()
|
---|
[a8ccc2c] | 137 | .HasColumnType("text");
|
---|
| 138 |
|
---|
| 139 | b.HasKey("Id");
|
---|
| 140 |
|
---|
| 141 | b.HasIndex("PharmacyHeadId");
|
---|
| 142 |
|
---|
[1db5673] | 143 | b.ToTable("Medicines");
|
---|
[a8ccc2c] | 144 | });
|
---|
| 145 |
|
---|
| 146 | modelBuilder.Entity("FarmatikoData.Models.Pandemic", b =>
|
---|
| 147 | {
|
---|
| 148 | b.Property<int>("Id")
|
---|
| 149 | .ValueGeneratedOnAdd()
|
---|
| 150 | .HasColumnType("integer")
|
---|
| 151 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 152 |
|
---|
[d23bf72] | 153 | b.Property<long>("ActiveGlobal")
|
---|
| 154 | .HasColumnType("bigint");
|
---|
[a8ccc2c] | 155 |
|
---|
| 156 | b.Property<int>("ActiveMK")
|
---|
| 157 | .HasColumnType("integer");
|
---|
| 158 |
|
---|
| 159 | b.Property<DateTime>("CreatedOn")
|
---|
| 160 | .HasColumnType("timestamp without time zone");
|
---|
| 161 |
|
---|
[d23bf72] | 162 | b.Property<long>("DeathsGlobal")
|
---|
| 163 | .HasColumnType("bigint");
|
---|
[a8ccc2c] | 164 |
|
---|
| 165 | b.Property<int>("DeathsMK")
|
---|
| 166 | .HasColumnType("integer");
|
---|
| 167 |
|
---|
[d23bf72] | 168 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 169 | .HasColumnType("timestamp without time zone");
|
---|
| 170 |
|
---|
| 171 | b.Property<string>("Name")
|
---|
[d23bf72] | 172 | .IsRequired()
|
---|
[a8ccc2c] | 173 | .HasColumnType("text");
|
---|
| 174 |
|
---|
| 175 | b.Property<int>("NewMK")
|
---|
| 176 | .HasColumnType("integer");
|
---|
| 177 |
|
---|
[d23bf72] | 178 | b.Property<long>("TotalGlobal")
|
---|
| 179 | .HasColumnType("bigint");
|
---|
[a8ccc2c] | 180 |
|
---|
| 181 | b.Property<int>("TotalMK")
|
---|
| 182 | .HasColumnType("integer");
|
---|
| 183 |
|
---|
| 184 | b.HasKey("Id");
|
---|
| 185 |
|
---|
| 186 | b.ToTable("Pandemics");
|
---|
| 187 | });
|
---|
| 188 |
|
---|
| 189 | modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b =>
|
---|
| 190 | {
|
---|
| 191 | b.Property<int>("Id")
|
---|
| 192 | .ValueGeneratedOnAdd()
|
---|
| 193 | .HasColumnType("integer")
|
---|
| 194 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 195 |
|
---|
| 196 | b.Property<string>("Address")
|
---|
[d23bf72] | 197 | .IsRequired()
|
---|
[a8ccc2c] | 198 | .HasColumnType("text");
|
---|
| 199 |
|
---|
| 200 | b.Property<DateTime>("CreatedOn")
|
---|
| 201 | .HasColumnType("timestamp without time zone");
|
---|
| 202 |
|
---|
[d23bf72] | 203 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 204 | .HasColumnType("timestamp without time zone");
|
---|
| 205 |
|
---|
| 206 | b.Property<string>("Location")
|
---|
[d23bf72] | 207 | .IsRequired()
|
---|
[a8ccc2c] | 208 | .HasColumnType("text");
|
---|
| 209 |
|
---|
| 210 | b.Property<string>("Name")
|
---|
[d23bf72] | 211 | .IsRequired()
|
---|
[a8ccc2c] | 212 | .HasColumnType("text");
|
---|
| 213 |
|
---|
[1db5673] | 214 | b.Property<int>("PheadId")
|
---|
[a8ccc2c] | 215 | .HasColumnType("integer");
|
---|
| 216 |
|
---|
| 217 | b.Property<bool>("WorkAllTime")
|
---|
| 218 | .HasColumnType("boolean");
|
---|
| 219 |
|
---|
| 220 | b.HasKey("Id");
|
---|
| 221 |
|
---|
[1db5673] | 222 | b.HasIndex("PheadId");
|
---|
[a8ccc2c] | 223 |
|
---|
| 224 | b.ToTable("Pharmacies");
|
---|
| 225 | });
|
---|
| 226 |
|
---|
| 227 | modelBuilder.Entity("FarmatikoData.Models.PharmacyHead", b =>
|
---|
| 228 | {
|
---|
| 229 | b.Property<int>("Id")
|
---|
| 230 | .ValueGeneratedOnAdd()
|
---|
| 231 | .HasColumnType("integer")
|
---|
| 232 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 233 |
|
---|
| 234 | b.Property<DateTime>("CreatedOn")
|
---|
| 235 | .HasColumnType("timestamp without time zone");
|
---|
| 236 |
|
---|
[d23bf72] | 237 | b.Property<DateTime?>("DeletedOn")
|
---|
[a8ccc2c] | 238 | .HasColumnType("timestamp without time zone");
|
---|
| 239 |
|
---|
| 240 | b.Property<string>("Email")
|
---|
[d23bf72] | 241 | .IsRequired()
|
---|
[a8ccc2c] | 242 | .HasColumnType("text");
|
---|
| 243 |
|
---|
| 244 | b.Property<string>("Name")
|
---|
[d23bf72] | 245 | .IsRequired()
|
---|
[a8ccc2c] | 246 | .HasColumnType("text");
|
---|
| 247 |
|
---|
| 248 | b.Property<string>("Password")
|
---|
[d23bf72] | 249 | .IsRequired()
|
---|
[a8ccc2c] | 250 | .HasColumnType("text");
|
---|
| 251 |
|
---|
[d23bf72] | 252 | b.HasKey("Id");
|
---|
| 253 |
|
---|
| 254 | b.ToTable("PharmacyHeads");
|
---|
| 255 | });
|
---|
| 256 |
|
---|
[1db5673] | 257 | modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b =>
|
---|
| 258 | {
|
---|
| 259 | b.Property<int>("PheadId")
|
---|
| 260 | .HasColumnType("integer");
|
---|
| 261 |
|
---|
| 262 | b.Property<int>("MedicineId")
|
---|
| 263 | .HasColumnType("integer");
|
---|
| 264 |
|
---|
| 265 | b.Property<DateTime>("CreatedOn")
|
---|
| 266 | .HasColumnType("timestamp without time zone");
|
---|
| 267 |
|
---|
| 268 | b.Property<DateTime?>("DeletedOn")
|
---|
| 269 | .HasColumnType("timestamp without time zone");
|
---|
| 270 |
|
---|
| 271 | b.Property<int>("Id")
|
---|
| 272 | .HasColumnType("integer");
|
---|
| 273 |
|
---|
| 274 | b.HasKey("PheadId", "MedicineId");
|
---|
| 275 |
|
---|
| 276 | b.HasIndex("MedicineId");
|
---|
| 277 |
|
---|
| 278 | b.ToTable("PharmacyHeadMedicines");
|
---|
| 279 | });
|
---|
| 280 |
|
---|
[d23bf72] | 281 | modelBuilder.Entity("FarmatikoData.Models.RequestPharmacyHead", b =>
|
---|
| 282 | {
|
---|
| 283 | b.Property<int>("Id")
|
---|
| 284 | .ValueGeneratedOnAdd()
|
---|
| 285 | .HasColumnType("integer")
|
---|
| 286 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 287 |
|
---|
| 288 | b.Property<DateTime>("CreatedOn")
|
---|
| 289 | .HasColumnType("timestamp without time zone");
|
---|
| 290 |
|
---|
| 291 | b.Property<DateTime?>("DeletedOn")
|
---|
| 292 | .HasColumnType("timestamp without time zone");
|
---|
| 293 |
|
---|
| 294 | b.Property<int>("HeadId")
|
---|
[a8ccc2c] | 295 | .HasColumnType("integer");
|
---|
| 296 |
|
---|
[d23bf72] | 297 | b.Property<int>("PharmacyId")
|
---|
[a8ccc2c] | 298 | .HasColumnType("integer");
|
---|
| 299 |
|
---|
| 300 | b.HasKey("Id");
|
---|
| 301 |
|
---|
[d23bf72] | 302 | b.HasIndex("HeadId");
|
---|
| 303 |
|
---|
[a8ccc2c] | 304 | b.HasIndex("PharmacyId");
|
---|
| 305 |
|
---|
[d23bf72] | 306 | b.ToTable("PHRequests");
|
---|
| 307 | });
|
---|
[a8ccc2c] | 308 |
|
---|
[d23bf72] | 309 | modelBuilder.Entity("FarmatikoData.Models.User", b =>
|
---|
| 310 | {
|
---|
| 311 | b.Property<int>("Id")
|
---|
| 312 | .ValueGeneratedOnAdd()
|
---|
| 313 | .HasColumnType("integer")
|
---|
| 314 | .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
---|
| 315 |
|
---|
| 316 | b.Property<DateTime>("CreatedOn")
|
---|
| 317 | .HasColumnType("timestamp without time zone");
|
---|
| 318 |
|
---|
| 319 | b.Property<DateTime?>("DeletedOn")
|
---|
| 320 | .HasColumnType("timestamp without time zone");
|
---|
| 321 |
|
---|
| 322 | b.Property<string>("Email")
|
---|
| 323 | .HasColumnType("text");
|
---|
| 324 |
|
---|
| 325 | b.Property<string>("Name")
|
---|
| 326 | .HasColumnType("text");
|
---|
| 327 |
|
---|
| 328 | b.Property<string>("Password")
|
---|
| 329 | .HasColumnType("text");
|
---|
| 330 |
|
---|
| 331 | b.Property<int>("UserRole")
|
---|
| 332 | .HasColumnType("integer");
|
---|
| 333 |
|
---|
| 334 | b.HasKey("Id");
|
---|
| 335 |
|
---|
| 336 | b.ToTable("Users");
|
---|
[a8ccc2c] | 337 | });
|
---|
| 338 |
|
---|
[d23bf72] | 339 | modelBuilder.Entity("FarmatikoData.Models.HealthcareWorker", b =>
|
---|
[a8ccc2c] | 340 | {
|
---|
[d23bf72] | 341 | b.HasOne("FarmatikoData.Models.HealthFacility", "Facility")
|
---|
[a8ccc2c] | 342 | .WithMany()
|
---|
| 343 | .HasForeignKey("FacilityId")
|
---|
| 344 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 345 | .IsRequired();
|
---|
| 346 | });
|
---|
| 347 |
|
---|
[1db5673] | 348 | modelBuilder.Entity("FarmatikoData.Models.Medicine", b =>
|
---|
[a8ccc2c] | 349 | {
|
---|
| 350 | b.HasOne("FarmatikoData.Models.PharmacyHead", null)
|
---|
[1db5673] | 351 | .WithMany("MedicineList")
|
---|
[a8ccc2c] | 352 | .HasForeignKey("PharmacyHeadId");
|
---|
| 353 | });
|
---|
| 354 |
|
---|
| 355 | modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b =>
|
---|
| 356 | {
|
---|
[1db5673] | 357 | b.HasOne("FarmatikoData.Models.PharmacyHead", "PHead")
|
---|
[a8ccc2c] | 358 | .WithMany("PharmaciesList")
|
---|
[1db5673] | 359 | .HasForeignKey("PheadId")
|
---|
| 360 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 361 | .IsRequired();
|
---|
| 362 | });
|
---|
| 363 |
|
---|
| 364 | modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b =>
|
---|
| 365 | {
|
---|
| 366 | b.HasOne("FarmatikoData.Models.Medicine", "Medicine")
|
---|
| 367 | .WithMany("MedicineList")
|
---|
| 368 | .HasForeignKey("MedicineId")
|
---|
| 369 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 370 | .IsRequired();
|
---|
| 371 |
|
---|
| 372 | b.HasOne("FarmatikoData.Models.PharmacyHead", "Head")
|
---|
| 373 | .WithMany("PHMedicineList")
|
---|
| 374 | .HasForeignKey("PheadId")
|
---|
| 375 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 376 | .IsRequired();
|
---|
[a8ccc2c] | 377 | });
|
---|
| 378 |
|
---|
[d23bf72] | 379 | modelBuilder.Entity("FarmatikoData.Models.RequestPharmacyHead", b =>
|
---|
[a8ccc2c] | 380 | {
|
---|
[d23bf72] | 381 | b.HasOne("FarmatikoData.Models.PharmacyHead", "Head")
|
---|
[a8ccc2c] | 382 | .WithMany()
|
---|
[d23bf72] | 383 | .HasForeignKey("HeadId")
|
---|
| 384 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 385 | .IsRequired();
|
---|
[a8ccc2c] | 386 |
|
---|
[d23bf72] | 387 | b.HasOne("FarmatikoData.Models.Pharmacy", "Pharmacy")
|
---|
[a8ccc2c] | 388 | .WithMany()
|
---|
[d23bf72] | 389 | .HasForeignKey("PharmacyId")
|
---|
| 390 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 391 | .IsRequired();
|
---|
[a8ccc2c] | 392 | });
|
---|
| 393 | #pragma warning restore 612, 618
|
---|
| 394 | }
|
---|
| 395 | }
|
---|
| 396 | }
|
---|