Changeset db484c9 for FarmatikoData/Migrations
- Timestamp:
- 01/26/21 10:33:09 (4 years ago)
- Branches:
- master
- Children:
- 7d80751
- Parents:
- 8e74e2f
- Location:
- FarmatikoData/Migrations
- Files:
-
- 1 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/Migrations/20210124191844_InitialMigration.Designer.cs
r8e74e2f rdb484c9 11 11 { 12 12 [DbContext(typeof(FarmatikoDataContext))] 13 [Migration("202 01115222819_InitialMigration")]13 [Migration("20210124191844_InitialMigration")] 14 14 partial class InitialMigration 15 15 { … … 124 124 .HasColumnType("text"); 125 125 126 b.Property<int?>("PharmacyHeadId")127 .HasColumnType("integer");128 129 126 b.Property<float>("Price") 130 127 .HasColumnType("real"); … … 140 137 b.HasKey("Id"); 141 138 142 b.HasIndex("PharmacyHeadId");143 144 139 b.ToTable("Medicines"); 145 140 }); … … 214 209 .HasColumnType("text"); 215 210 211 b.Property<int?>("PharmacyHeadId") 212 .HasColumnType("integer"); 213 216 214 b.Property<int>("PheadId") 217 215 .HasColumnType("integer"); … … 222 220 b.HasKey("Id"); 223 221 224 b.HasIndex("Ph eadId");222 b.HasIndex("PharmacyHeadId"); 225 223 226 224 b.ToTable("Pharmacies"); … … 253 251 .HasColumnType("text"); 254 252 255 b.HasKey("Id"); 253 b.Property<int?>("UserId") 254 .HasColumnType("integer"); 255 256 b.HasKey("Id"); 257 258 b.HasIndex("UserId"); 256 259 257 260 b.ToTable("PharmacyHeads"); … … 260 263 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 261 264 { 265 b.Property<int>("Id") 266 .ValueGeneratedOnAdd() 267 .HasColumnType("integer") 268 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'") 269 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn); 270 271 b.Property<DateTime>("CreatedOn") 272 .HasColumnType("timestamp without time zone"); 273 274 b.Property<DateTime?>("DeletedOn") 275 .HasColumnType("timestamp without time zone"); 276 277 b.Property<int?>("HeadId") 278 .HasColumnType("integer"); 279 280 b.Property<int>("MedicineId") 281 .HasColumnType("integer"); 282 262 283 b.Property<int>("PheadId") 263 284 .HasColumnType("integer"); 264 285 265 b.Property<int>("MedicineId") 266 .HasColumnType("integer"); 267 268 b.Property<DateTime>("CreatedOn") 269 .HasColumnType("timestamp without time zone"); 270 271 b.Property<DateTime?>("DeletedOn") 272 .HasColumnType("timestamp without time zone"); 273 274 b.Property<int>("Id") 275 .HasColumnType("integer") 276 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'"); 277 278 b.HasKey("PheadId", "MedicineId"); 286 b.HasKey("Id"); 287 288 b.HasIndex("HeadId"); 279 289 280 290 b.HasIndex("MedicineId"); … … 317 327 .ValueGeneratedOnAdd() 318 328 .HasColumnType("integer") 319 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'")320 329 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn); 321 330 … … 355 364 }); 356 365 357 modelBuilder.Entity("FarmatikoData.Models. Medicine", b =>358 { 359 b.HasOne("FarmatikoData.Models.PharmacyHead", null)360 .WithMany(" MedicineList")366 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 367 { 368 b.HasOne("FarmatikoData.Models.PharmacyHead", "PharmacyHead") 369 .WithMany("Pharmacies") 361 370 .HasForeignKey("PharmacyHeadId"); 362 371 }); 363 372 364 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 365 { 366 b.HasOne("FarmatikoData.Models.PharmacyHead", "PHead") 367 .WithMany("PharmaciesList") 368 .HasForeignKey("PheadId") 369 .OnDelete(DeleteBehavior.Cascade) 370 .IsRequired(); 373 modelBuilder.Entity("FarmatikoData.Models.PharmacyHead", b => 374 { 375 b.HasOne("FarmatikoData.Models.User", "User") 376 .WithMany() 377 .HasForeignKey("UserId"); 371 378 }); 372 379 373 380 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 374 381 { 382 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 383 .WithMany("Medicines") 384 .HasForeignKey("HeadId"); 385 375 386 b.HasOne("FarmatikoData.Models.Medicine", "Medicine") 376 .WithMany("Medicine List")387 .WithMany("Medicines") 377 388 .HasForeignKey("MedicineId") 378 .OnDelete(DeleteBehavior.Cascade)379 .IsRequired();380 381 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head")382 .WithMany("PHMedicineList")383 .HasForeignKey("PheadId")384 389 .OnDelete(DeleteBehavior.Cascade) 385 390 .IsRequired(); -
FarmatikoData/Migrations/20210124191844_InitialMigration.cs
r8e74e2f rdb484c9 15 15 Id = table.Column<int>(nullable: false) 16 16 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), 17 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"),17 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 18 18 DeletedOn = table.Column<DateTime>(nullable: true), 19 19 Name = table.Column<string>(nullable: false), … … 27 27 { 28 28 table.PrimaryKey("PK_HealthFacilities", x => x.Id); 29 }); 30 31 migrationBuilder.CreateTable( 32 name: "Medicines", 33 columns: table => new 34 { 35 Id = table.Column<int>(nullable: false) 36 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), 37 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 38 DeletedOn = table.Column<DateTime>(nullable: true), 39 Name = table.Column<string>(nullable: false), 40 Strength = table.Column<string>(nullable: false), 41 Form = table.Column<string>(nullable: true), 42 WayOfIssuing = table.Column<string>(nullable: false), 43 Manufacturer = table.Column<string>(nullable: false), 44 Price = table.Column<float>(nullable: false), 45 Packaging = table.Column<string>(nullable: true) 46 }, 47 constraints: table => 48 { 49 table.PrimaryKey("PK_Medicines", x => x.Id); 29 50 }); 30 51 … … 52 73 53 74 migrationBuilder.CreateTable( 54 name: "PharmacyHeads",55 columns: table => new56 {57 Id = table.Column<int>(nullable: false)58 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),59 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"),60 DeletedOn = table.Column<DateTime>(nullable: true),61 Email = table.Column<string>(nullable: false),62 Name = table.Column<string>(nullable: false),63 Password = table.Column<string>(nullable: false)64 },65 constraints: table =>66 {67 table.PrimaryKey("PK_PharmacyHeads", x => x.Id);68 });69 70 migrationBuilder.CreateTable(71 75 name: "Users", 72 76 columns: table => new … … 111 115 112 116 migrationBuilder.CreateTable( 113 name: "Medicines", 114 columns: table => new 115 { 116 Id = table.Column<int>(nullable: false) 117 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), 118 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 119 DeletedOn = table.Column<DateTime>(nullable: true), 120 Name = table.Column<string>(nullable: false), 121 Strength = table.Column<string>(nullable: false), 122 Form = table.Column<string>(nullable: true), 123 WayOfIssuing = table.Column<string>(nullable: false), 124 Manufacturer = table.Column<string>(nullable: false), 125 Price = table.Column<float>(nullable: false), 126 Packaging = table.Column<string>(nullable: true), 127 PharmacyHeadId = table.Column<int>(nullable: true) 128 }, 129 constraints: table => 130 { 131 table.PrimaryKey("PK_Medicines", x => x.Id); 132 table.ForeignKey( 133 name: "FK_Medicines_PharmacyHeads_PharmacyHeadId", 134 column: x => x.PharmacyHeadId, 135 principalTable: "PharmacyHeads", 117 name: "PharmacyHeads", 118 columns: table => new 119 { 120 Id = table.Column<int>(nullable: false) 121 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), 122 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 123 DeletedOn = table.Column<DateTime>(nullable: true), 124 Email = table.Column<string>(nullable: false), 125 Name = table.Column<string>(nullable: false), 126 Password = table.Column<string>(nullable: false), 127 UserId = table.Column<int>(nullable: true) 128 }, 129 constraints: table => 130 { 131 table.PrimaryKey("PK_PharmacyHeads", x => x.Id); 132 table.ForeignKey( 133 name: "FK_PharmacyHeads_Users_UserId", 134 column: x => x.UserId, 135 principalTable: "Users", 136 136 principalColumn: "Id", 137 137 onDelete: ReferentialAction.Restrict); … … 150 150 Address = table.Column<string>(nullable: false), 151 151 WorkAllTime = table.Column<bool>(nullable: false), 152 PheadId = table.Column<int>(nullable: false) 152 PheadId = table.Column<int>(nullable: false), 153 PharmacyHeadId = table.Column<int>(nullable: true) 153 154 }, 154 155 constraints: table => … … 156 157 table.PrimaryKey("PK_Pharmacies", x => x.Id); 157 158 table.ForeignKey( 158 name: "FK_Pharmacies_PharmacyHeads_Ph eadId",159 column: x => x.Ph eadId,159 name: "FK_Pharmacies_PharmacyHeads_PharmacyHeadId", 160 column: x => x.PharmacyHeadId, 160 161 principalTable: "PharmacyHeads", 161 162 principalColumn: "Id", 162 onDelete: ReferentialAction. Cascade);163 onDelete: ReferentialAction.Restrict); 163 164 }); 164 165 … … 167 168 columns: table => new 168 169 { 170 Id = table.Column<int>(nullable: false) 171 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), 172 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 173 DeletedOn = table.Column<DateTime>(nullable: true), 169 174 PheadId = table.Column<int>(nullable: false), 170 MedicineId = table.Column<int>(nullable: false), 171 Id = table.Column<int>(nullable: false), 172 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 173 DeletedOn = table.Column<DateTime>(nullable: true) 174 }, 175 constraints: table => 176 { 177 table.PrimaryKey("PK_PharmacyHeadMedicines", x => new { x.PheadId, x.MedicineId }); 175 HeadId = table.Column<int>(nullable: true), 176 MedicineId = table.Column<int>(nullable: false) 177 }, 178 constraints: table => 179 { 180 table.PrimaryKey("PK_PharmacyHeadMedicines", x => x.Id); 181 table.ForeignKey( 182 name: "FK_PharmacyHeadMedicines_PharmacyHeads_HeadId", 183 column: x => x.HeadId, 184 principalTable: "PharmacyHeads", 185 principalColumn: "Id", 186 onDelete: ReferentialAction.Restrict); 178 187 table.ForeignKey( 179 188 name: "FK_PharmacyHeadMedicines_Medicines_MedicineId", … … 182 191 principalColumn: "Id", 183 192 onDelete: ReferentialAction.Cascade); 184 table.ForeignKey(185 name: "FK_PharmacyHeadMedicines_PharmacyHeads_PheadId",186 column: x => x.PheadId,187 principalTable: "PharmacyHeads",188 principalColumn: "Id",189 onDelete: ReferentialAction.Cascade);190 193 }); 191 194 … … 224 227 225 228 migrationBuilder.CreateIndex( 226 name: "IX_ Medicines_PharmacyHeadId",227 table: " Medicines",229 name: "IX_Pharmacies_PharmacyHeadId", 230 table: "Pharmacies", 228 231 column: "PharmacyHeadId"); 229 232 230 233 migrationBuilder.CreateIndex( 231 name: "IX_Pharmac ies_PheadId",232 table: "Pharmac ies",233 column: " PheadId");234 name: "IX_PharmacyHeadMedicines_HeadId", 235 table: "PharmacyHeadMedicines", 236 column: "HeadId"); 234 237 235 238 migrationBuilder.CreateIndex( … … 237 240 table: "PharmacyHeadMedicines", 238 241 column: "MedicineId"); 242 243 migrationBuilder.CreateIndex( 244 name: "IX_PharmacyHeads_UserId", 245 table: "PharmacyHeads", 246 column: "UserId"); 239 247 240 248 migrationBuilder.CreateIndex( … … 264 272 265 273 migrationBuilder.DropTable( 274 name: "HealthFacilities"); 275 276 migrationBuilder.DropTable( 277 name: "Medicines"); 278 279 migrationBuilder.DropTable( 280 name: "Pharmacies"); 281 282 migrationBuilder.DropTable( 283 name: "PharmacyHeads"); 284 285 migrationBuilder.DropTable( 266 286 name: "Users"); 267 268 migrationBuilder.DropTable(269 name: "HealthFacilities");270 271 migrationBuilder.DropTable(272 name: "Medicines");273 274 migrationBuilder.DropTable(275 name: "Pharmacies");276 277 migrationBuilder.DropTable(278 name: "PharmacyHeads");279 287 } 280 288 } -
FarmatikoData/Migrations/FarmatikoDataContextModelSnapshot.cs
r8e74e2f rdb484c9 122 122 .HasColumnType("text"); 123 123 124 b.Property<int?>("PharmacyHeadId")125 .HasColumnType("integer");126 127 124 b.Property<float>("Price") 128 125 .HasColumnType("real"); … … 138 135 b.HasKey("Id"); 139 136 140 b.HasIndex("PharmacyHeadId");141 142 137 b.ToTable("Medicines"); 143 138 }); … … 212 207 .HasColumnType("text"); 213 208 209 b.Property<int?>("PharmacyHeadId") 210 .HasColumnType("integer"); 211 214 212 b.Property<int>("PheadId") 215 213 .HasColumnType("integer"); … … 220 218 b.HasKey("Id"); 221 219 222 b.HasIndex("Ph eadId");220 b.HasIndex("PharmacyHeadId"); 223 221 224 222 b.ToTable("Pharmacies"); … … 251 249 .HasColumnType("text"); 252 250 253 b.HasKey("Id"); 251 b.Property<int?>("UserId") 252 .HasColumnType("integer"); 253 254 b.HasKey("Id"); 255 256 b.HasIndex("UserId"); 254 257 255 258 b.ToTable("PharmacyHeads"); … … 258 261 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 259 262 { 263 b.Property<int>("Id") 264 .ValueGeneratedOnAdd() 265 .HasColumnType("integer") 266 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'") 267 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn); 268 269 b.Property<DateTime>("CreatedOn") 270 .HasColumnType("timestamp without time zone"); 271 272 b.Property<DateTime?>("DeletedOn") 273 .HasColumnType("timestamp without time zone"); 274 275 b.Property<int?>("HeadId") 276 .HasColumnType("integer"); 277 278 b.Property<int>("MedicineId") 279 .HasColumnType("integer"); 280 260 281 b.Property<int>("PheadId") 261 282 .HasColumnType("integer"); 262 283 263 b.Property<int>("MedicineId") 264 .HasColumnType("integer"); 265 266 b.Property<DateTime>("CreatedOn") 267 .HasColumnType("timestamp without time zone"); 268 269 b.Property<DateTime?>("DeletedOn") 270 .HasColumnType("timestamp without time zone"); 271 272 b.Property<int>("Id") 273 .HasColumnType("integer") 274 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'"); 275 276 b.HasKey("PheadId", "MedicineId"); 284 b.HasKey("Id"); 285 286 b.HasIndex("HeadId"); 277 287 278 288 b.HasIndex("MedicineId"); … … 315 325 .ValueGeneratedOnAdd() 316 326 .HasColumnType("integer") 317 .HasAnnotation("Npgsql:IdentitySequenceOptions", "'1', '1', '', '', 'False', '1'")318 327 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn); 319 328 … … 353 362 }); 354 363 355 modelBuilder.Entity("FarmatikoData.Models. Medicine", b =>356 { 357 b.HasOne("FarmatikoData.Models.PharmacyHead", null)358 .WithMany(" MedicineList")364 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 365 { 366 b.HasOne("FarmatikoData.Models.PharmacyHead", "PharmacyHead") 367 .WithMany("Pharmacies") 359 368 .HasForeignKey("PharmacyHeadId"); 360 369 }); 361 370 362 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 363 { 364 b.HasOne("FarmatikoData.Models.PharmacyHead", "PHead") 365 .WithMany("PharmaciesList") 366 .HasForeignKey("PheadId") 367 .OnDelete(DeleteBehavior.Cascade) 368 .IsRequired(); 371 modelBuilder.Entity("FarmatikoData.Models.PharmacyHead", b => 372 { 373 b.HasOne("FarmatikoData.Models.User", "User") 374 .WithMany() 375 .HasForeignKey("UserId"); 369 376 }); 370 377 371 378 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 372 379 { 380 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 381 .WithMany("Medicines") 382 .HasForeignKey("HeadId"); 383 373 384 b.HasOne("FarmatikoData.Models.Medicine", "Medicine") 374 .WithMany("Medicine List")385 .WithMany("Medicines") 375 386 .HasForeignKey("MedicineId") 376 .OnDelete(DeleteBehavior.Cascade)377 .IsRequired();378 379 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head")380 .WithMany("PHMedicineList")381 .HasForeignKey("PheadId")382 387 .OnDelete(DeleteBehavior.Cascade) 383 388 .IsRequired();
Note:
See TracChangeset
for help on using the changeset viewer.