Changeset e0cdea2 for FarmatikoData/Migrations
- Timestamp:
- 02/08/21 16:39:25 (4 years ago)
- Branches:
- master
- Children:
- 8eb1e21, dae4cde
- Parents:
- 0a694bb
- Location:
- FarmatikoData/Migrations
- Files:
-
- 1 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/Migrations/20210208041424_Initial-Create.Designer.cs
r0a694bb re0cdea2 11 11 { 12 12 [DbContext(typeof(FarmatikoDataContext))] 13 [Migration("2021020 5174704_Initial-Migration")]14 partial class Initial Migration13 [Migration("20210208041424_Initial-Create")] 14 partial class InitialCreate 15 15 { 16 16 protected override void BuildTargetModel(ModelBuilder modelBuilder) … … 207 207 .HasColumnType("text"); 208 208 209 b.Property<int?>("PharmacyHeadId") 210 .HasColumnType("integer"); 211 212 b.Property<int>("PheadId") 209 b.Property<int?>("PheadId") 213 210 .HasColumnType("integer"); 214 211 … … 218 215 b.HasKey("Id"); 219 216 220 b.HasIndex("Ph armacyHeadId");217 b.HasIndex("PheadId"); 221 218 222 219 b.ToTable("Pharmacies"); … … 302 299 .HasColumnType("timestamp without time zone"); 303 300 304 b.Property<int >("HeadId")305 .HasColumnType("integer"); 306 307 b.Property<int >("PharmacyId")301 b.Property<int?>("HeadId") 302 .HasColumnType("integer"); 303 304 b.Property<int?>("PharmacyId") 308 305 .HasColumnType("integer"); 309 306 … … 363 360 b.HasOne("FarmatikoData.Models.PharmacyHead", "PharmacyHead") 364 361 .WithMany("Pharmacies") 365 .HasForeignKey("Ph armacyHeadId");362 .HasForeignKey("PheadId"); 366 363 }); 367 364 … … 392 389 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 393 390 .WithMany() 394 .HasForeignKey("HeadId") 395 .OnDelete(DeleteBehavior.Cascade) 396 .IsRequired(); 391 .HasForeignKey("HeadId"); 397 392 398 393 b.HasOne("FarmatikoData.Models.Pharmacy", "Pharmacy") 399 394 .WithMany() 400 .HasForeignKey("PharmacyId") 401 .OnDelete(DeleteBehavior.Cascade) 402 .IsRequired(); 395 .HasForeignKey("PharmacyId"); 403 396 }); 404 397 #pragma warning restore 612, 618 -
FarmatikoData/Migrations/20210208041424_Initial-Create.cs
r0a694bb re0cdea2 5 5 namespace FarmatikoData.Migrations 6 6 { 7 public partial class Initial Migration: Migration7 public partial class InitialCreate : Migration 8 8 { 9 9 protected override void Up(MigrationBuilder migrationBuilder) … … 150 150 Address = table.Column<string>(nullable: false), 151 151 WorkAllTime = table.Column<bool>(nullable: false), 152 PheadId = table.Column<int>(nullable: false), 153 PharmacyHeadId = table.Column<int>(nullable: true) 152 PheadId = table.Column<int>(nullable: true) 154 153 }, 155 154 constraints: table => … … 157 156 table.PrimaryKey("PK_Pharmacies", x => x.Id); 158 157 table.ForeignKey( 159 name: "FK_Pharmacies_PharmacyHeads_Ph armacyHeadId",160 column: x => x.Ph armacyHeadId,158 name: "FK_Pharmacies_PharmacyHeads_PheadId", 159 column: x => x.PheadId, 161 160 principalTable: "PharmacyHeads", 162 161 principalColumn: "Id", … … 201 200 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 202 201 DeletedOn = table.Column<DateTime>(nullable: true), 203 HeadId = table.Column<int>(nullable: false),204 PharmacyId = table.Column<int>(nullable: false)202 HeadId = table.Column<int>(nullable: true), 203 PharmacyId = table.Column<int>(nullable: true) 205 204 }, 206 205 constraints: table => … … 212 211 principalTable: "PharmacyHeads", 213 212 principalColumn: "Id", 214 onDelete: ReferentialAction. Cascade);213 onDelete: ReferentialAction.Restrict); 215 214 table.ForeignKey( 216 215 name: "FK_PHRequests_Pharmacies_PharmacyId", … … 218 217 principalTable: "Pharmacies", 219 218 principalColumn: "Id", 220 onDelete: ReferentialAction. Cascade);219 onDelete: ReferentialAction.Restrict); 221 220 }); 222 221 … … 227 226 228 227 migrationBuilder.CreateIndex( 229 name: "IX_Pharmacies_Ph armacyHeadId",228 name: "IX_Pharmacies_PheadId", 230 229 table: "Pharmacies", 231 column: "Ph armacyHeadId");230 column: "PheadId"); 232 231 233 232 migrationBuilder.CreateIndex( -
FarmatikoData/Migrations/FarmatikoDataContextModelSnapshot.cs
r0a694bb re0cdea2 205 205 .HasColumnType("text"); 206 206 207 b.Property<int?>("PharmacyHeadId") 208 .HasColumnType("integer"); 209 210 b.Property<int>("PheadId") 207 b.Property<int?>("PheadId") 211 208 .HasColumnType("integer"); 212 209 … … 216 213 b.HasKey("Id"); 217 214 218 b.HasIndex("Ph armacyHeadId");215 b.HasIndex("PheadId"); 219 216 220 217 b.ToTable("Pharmacies"); … … 300 297 .HasColumnType("timestamp without time zone"); 301 298 302 b.Property<int >("HeadId")303 .HasColumnType("integer"); 304 305 b.Property<int >("PharmacyId")299 b.Property<int?>("HeadId") 300 .HasColumnType("integer"); 301 302 b.Property<int?>("PharmacyId") 306 303 .HasColumnType("integer"); 307 304 … … 361 358 b.HasOne("FarmatikoData.Models.PharmacyHead", "PharmacyHead") 362 359 .WithMany("Pharmacies") 363 .HasForeignKey("Ph armacyHeadId");360 .HasForeignKey("PheadId"); 364 361 }); 365 362 … … 390 387 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 391 388 .WithMany() 392 .HasForeignKey("HeadId") 393 .OnDelete(DeleteBehavior.Cascade) 394 .IsRequired(); 389 .HasForeignKey("HeadId"); 395 390 396 391 b.HasOne("FarmatikoData.Models.Pharmacy", "Pharmacy") 397 392 .WithMany() 398 .HasForeignKey("PharmacyId") 399 .OnDelete(DeleteBehavior.Cascade) 400 .IsRequired(); 393 .HasForeignKey("PharmacyId"); 401 394 }); 402 395 #pragma warning restore 612, 618
Note:
See TracChangeset
for help on using the changeset viewer.