Changeset 1db5673 for FarmatikoData/Migrations
- Timestamp:
- 11/14/20 12:27:30 (4 years ago)
- Branches:
- master
- Children:
- 68454c6
- Parents:
- ad60966
- Location:
- FarmatikoData/Migrations
- Files:
-
- 1 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/Migrations/20201111183247_InitialMigration.Designer.cs
rad60966 r1db5673 11 11 { 12 12 [DbContext(typeof(FarmatikoDataContext))] 13 [Migration("202011 05063549_InitialMigration")]13 [Migration("20201111183247_InitialMigration")] 14 14 partial class InitialMigration 15 15 { … … 123 123 .HasColumnType("text"); 124 124 125 b.Property<int?>("PharmacyHeadId") 126 .HasColumnType("integer"); 127 125 128 b.Property<float>("Price") 126 129 .HasColumnType("real"); … … 136 139 b.HasKey("Id"); 137 140 141 b.HasIndex("PharmacyHeadId"); 142 138 143 b.ToTable("Medicines"); 139 });140 141 modelBuilder.Entity("FarmatikoData.Models.MedicineList", b =>142 {143 b.Property<int>("Id")144 .ValueGeneratedOnAdd()145 .HasColumnType("integer")146 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);147 148 b.Property<DateTime>("CreatedOn")149 .HasColumnType("timestamp without time zone");150 151 b.Property<DateTime?>("DeletedOn")152 .HasColumnType("timestamp without time zone");153 154 b.Property<bool>("HasMedicine")155 .HasColumnType("boolean");156 157 b.Property<int>("MedicineId")158 .HasColumnType("integer");159 160 b.Property<int?>("PharmacyHeadId")161 .HasColumnType("integer");162 163 b.HasKey("Id");164 165 b.HasIndex("MedicineId");166 167 b.HasIndex("PharmacyHeadId");168 169 b.ToTable("MedicineList");170 144 }); 171 145 … … 238 212 .HasColumnType("text"); 239 213 240 b.Property<int ?>("PharmacyHeadId")214 b.Property<int>("PheadId") 241 215 .HasColumnType("integer"); 242 216 … … 246 220 b.HasKey("Id"); 247 221 248 b.HasIndex("Ph armacyHeadId");222 b.HasIndex("PheadId"); 249 223 250 224 b.ToTable("Pharmacies"); … … 279 253 280 254 b.ToTable("PharmacyHeads"); 255 }); 256 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"); 281 279 }); 282 280 … … 348 346 }); 349 347 350 modelBuilder.Entity("FarmatikoData.Models.MedicineList", b => 348 modelBuilder.Entity("FarmatikoData.Models.Medicine", b => 349 { 350 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 351 .WithMany("MedicineList") 352 .HasForeignKey("PharmacyHeadId"); 353 }); 354 355 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 356 { 357 b.HasOne("FarmatikoData.Models.PharmacyHead", "PHead") 358 .WithMany("PharmaciesList") 359 .HasForeignKey("PheadId") 360 .OnDelete(DeleteBehavior.Cascade) 361 .IsRequired(); 362 }); 363 364 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 351 365 { 352 366 b.HasOne("FarmatikoData.Models.Medicine", "Medicine") 353 .WithMany( )367 .WithMany("MedicineList") 354 368 .HasForeignKey("MedicineId") 355 369 .OnDelete(DeleteBehavior.Cascade) 356 370 .IsRequired(); 357 371 358 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 359 .WithMany("MedicineLists") 360 .HasForeignKey("PharmacyHeadId"); 361 }); 362 363 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 364 { 365 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 366 .WithMany("PharmaciesList") 367 .HasForeignKey("PharmacyHeadId"); 372 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 373 .WithMany("PHMedicineList") 374 .HasForeignKey("PheadId") 375 .OnDelete(DeleteBehavior.Cascade) 376 .IsRequired(); 368 377 }); 369 378 -
FarmatikoData/Migrations/20201111183247_InitialMigration.cs
rad60966 r1db5673 15 15 Id = table.Column<int>(nullable: false) 16 16 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 17 CreatedOn = table.Column<DateTime>(nullable: false ),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), … … 30 30 31 31 migrationBuilder.CreateTable( 32 name: "Medicines",33 columns: table => new34 {35 Id = table.Column<int>(nullable: false)36 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),37 CreatedOn = table.Column<DateTime>(nullable: false),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);50 });51 52 migrationBuilder.CreateTable(53 32 name: "Pandemics", 54 33 columns: table => new … … 56 35 Id = table.Column<int>(nullable: false) 57 36 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 58 CreatedOn = table.Column<DateTime>(nullable: false ),37 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 59 38 DeletedOn = table.Column<DateTime>(nullable: true), 60 39 Name = table.Column<string>(nullable: false), … … 78 57 Id = table.Column<int>(nullable: false) 79 58 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 80 CreatedOn = table.Column<DateTime>(nullable: false ),59 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 81 60 DeletedOn = table.Column<DateTime>(nullable: true), 82 61 Email = table.Column<string>(nullable: false), … … 95 74 Id = table.Column<int>(nullable: false) 96 75 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 97 CreatedOn = table.Column<DateTime>(nullable: false ),98 DeletedOn = table.Column<DateTime>(nullable: true), 99 Name = table.Column<string>(nullable: true),100 Email = table.Column<string>(nullable: true),101 Password = table.Column<string>(nullable: true),76 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 77 DeletedOn = table.Column<DateTime>(nullable: true), 78 Name = table.Column<string>(nullable: false), 79 Email = table.Column<string>(nullable: false), 80 Password = table.Column<string>(nullable: false), 102 81 UserRole = table.Column<int>(nullable: false) 103 82 }, … … 113 92 Id = table.Column<int>(nullable: false) 114 93 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 115 CreatedOn = table.Column<DateTime>(nullable: false ),94 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 116 95 DeletedOn = table.Column<DateTime>(nullable: true), 117 96 Name = table.Column<string>(nullable: false), … … 132 111 133 112 migrationBuilder.CreateTable( 134 name: "MedicineList", 135 columns: table => new 136 { 137 Id = table.Column<int>(nullable: false) 138 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 139 CreatedOn = table.Column<DateTime>(nullable: false), 140 DeletedOn = table.Column<DateTime>(nullable: true), 141 MedicineId = table.Column<int>(nullable: false), 142 HasMedicine = table.Column<bool>(nullable: false), 113 name: "Medicines", 114 columns: table => new 115 { 116 Id = table.Column<int>(nullable: false) 117 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 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), 143 127 PharmacyHeadId = table.Column<int>(nullable: true) 144 128 }, 145 129 constraints: table => 146 130 { 147 table.PrimaryKey("PK_MedicineList", x => x.Id); 148 table.ForeignKey( 149 name: "FK_MedicineList_Medicines_MedicineId", 150 column: x => x.MedicineId, 151 principalTable: "Medicines", 152 principalColumn: "Id", 153 onDelete: ReferentialAction.Cascade); 154 table.ForeignKey( 155 name: "FK_MedicineList_PharmacyHeads_PharmacyHeadId", 131 table.PrimaryKey("PK_Medicines", x => x.Id); 132 table.ForeignKey( 133 name: "FK_Medicines_PharmacyHeads_PharmacyHeadId", 156 134 column: x => x.PharmacyHeadId, 157 135 principalTable: "PharmacyHeads", … … 172 150 Address = table.Column<string>(nullable: false), 173 151 WorkAllTime = table.Column<bool>(nullable: false), 174 Ph armacyHeadId = table.Column<int>(nullable: true)152 PheadId = table.Column<int>(nullable: false) 175 153 }, 176 154 constraints: table => … … 178 156 table.PrimaryKey("PK_Pharmacies", x => x.Id); 179 157 table.ForeignKey( 180 name: "FK_Pharmacies_PharmacyHeads_PharmacyHeadId", 181 column: x => x.PharmacyHeadId, 182 principalTable: "PharmacyHeads", 183 principalColumn: "Id", 184 onDelete: ReferentialAction.Restrict); 158 name: "FK_Pharmacies_PharmacyHeads_PheadId", 159 column: x => x.PheadId, 160 principalTable: "PharmacyHeads", 161 principalColumn: "Id", 162 onDelete: ReferentialAction.Cascade); 163 }); 164 165 migrationBuilder.CreateTable( 166 name: "PharmacyHeadMedicines", 167 columns: table => new 168 { 169 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 }); 178 table.ForeignKey( 179 name: "FK_PharmacyHeadMedicines_Medicines_MedicineId", 180 column: x => x.MedicineId, 181 principalTable: "Medicines", 182 principalColumn: "Id", 183 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); 185 190 }); 186 191 … … 191 196 Id = table.Column<int>(nullable: false) 192 197 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 193 CreatedOn = table.Column<DateTime>(nullable: false ),198 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 194 199 DeletedOn = table.Column<DateTime>(nullable: true), 195 200 HeadId = table.Column<int>(nullable: false), … … 219 224 220 225 migrationBuilder.CreateIndex( 221 name: "IX_MedicineList_MedicineId", 222 table: "MedicineList", 226 name: "IX_Medicines_PharmacyHeadId", 227 table: "Medicines", 228 column: "PharmacyHeadId"); 229 230 migrationBuilder.CreateIndex( 231 name: "IX_Pharmacies_PheadId", 232 table: "Pharmacies", 233 column: "PheadId"); 234 235 migrationBuilder.CreateIndex( 236 name: "IX_PharmacyHeadMedicines_MedicineId", 237 table: "PharmacyHeadMedicines", 223 238 column: "MedicineId"); 224 225 migrationBuilder.CreateIndex(226 name: "IX_MedicineList_PharmacyHeadId",227 table: "MedicineList",228 column: "PharmacyHeadId");229 230 migrationBuilder.CreateIndex(231 name: "IX_Pharmacies_PharmacyHeadId",232 table: "Pharmacies",233 column: "PharmacyHeadId");234 239 235 240 migrationBuilder.CreateIndex( … … 250 255 251 256 migrationBuilder.DropTable( 252 name: "MedicineList");253 254 migrationBuilder.DropTable(255 257 name: "Pandemics"); 258 259 migrationBuilder.DropTable( 260 name: "PharmacyHeadMedicines"); 256 261 257 262 migrationBuilder.DropTable( -
FarmatikoData/Migrations/FarmatikoDataContextModelSnapshot.cs
rad60966 r1db5673 121 121 .HasColumnType("text"); 122 122 123 b.Property<int?>("PharmacyHeadId") 124 .HasColumnType("integer"); 125 123 126 b.Property<float>("Price") 124 127 .HasColumnType("real"); … … 134 137 b.HasKey("Id"); 135 138 139 b.HasIndex("PharmacyHeadId"); 140 136 141 b.ToTable("Medicines"); 137 });138 139 modelBuilder.Entity("FarmatikoData.Models.MedicineList", b =>140 {141 b.Property<int>("Id")142 .ValueGeneratedOnAdd()143 .HasColumnType("integer")144 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);145 146 b.Property<DateTime>("CreatedOn")147 .HasColumnType("timestamp without time zone");148 149 b.Property<DateTime?>("DeletedOn")150 .HasColumnType("timestamp without time zone");151 152 b.Property<bool>("HasMedicine")153 .HasColumnType("boolean");154 155 b.Property<int>("MedicineId")156 .HasColumnType("integer");157 158 b.Property<int?>("PharmacyHeadId")159 .HasColumnType("integer");160 161 b.HasKey("Id");162 163 b.HasIndex("MedicineId");164 165 b.HasIndex("PharmacyHeadId");166 167 b.ToTable("MedicineList");168 142 }); 169 143 … … 236 210 .HasColumnType("text"); 237 211 238 b.Property<int ?>("PharmacyHeadId")212 b.Property<int>("PheadId") 239 213 .HasColumnType("integer"); 240 214 … … 244 218 b.HasKey("Id"); 245 219 246 b.HasIndex("Ph armacyHeadId");220 b.HasIndex("PheadId"); 247 221 248 222 b.ToTable("Pharmacies"); … … 277 251 278 252 b.ToTable("PharmacyHeads"); 253 }); 254 255 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 256 { 257 b.Property<int>("PheadId") 258 .HasColumnType("integer"); 259 260 b.Property<int>("MedicineId") 261 .HasColumnType("integer"); 262 263 b.Property<DateTime>("CreatedOn") 264 .HasColumnType("timestamp without time zone"); 265 266 b.Property<DateTime?>("DeletedOn") 267 .HasColumnType("timestamp without time zone"); 268 269 b.Property<int>("Id") 270 .HasColumnType("integer"); 271 272 b.HasKey("PheadId", "MedicineId"); 273 274 b.HasIndex("MedicineId"); 275 276 b.ToTable("PharmacyHeadMedicines"); 279 277 }); 280 278 … … 346 344 }); 347 345 348 modelBuilder.Entity("FarmatikoData.Models.MedicineList", b => 346 modelBuilder.Entity("FarmatikoData.Models.Medicine", b => 347 { 348 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 349 .WithMany("MedicineList") 350 .HasForeignKey("PharmacyHeadId"); 351 }); 352 353 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 354 { 355 b.HasOne("FarmatikoData.Models.PharmacyHead", "PHead") 356 .WithMany("PharmaciesList") 357 .HasForeignKey("PheadId") 358 .OnDelete(DeleteBehavior.Cascade) 359 .IsRequired(); 360 }); 361 362 modelBuilder.Entity("FarmatikoData.Models.PharmacyHeadMedicine", b => 349 363 { 350 364 b.HasOne("FarmatikoData.Models.Medicine", "Medicine") 351 .WithMany( )365 .WithMany("MedicineList") 352 366 .HasForeignKey("MedicineId") 353 367 .OnDelete(DeleteBehavior.Cascade) 354 368 .IsRequired(); 355 369 356 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 357 .WithMany("MedicineLists") 358 .HasForeignKey("PharmacyHeadId"); 359 }); 360 361 modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => 362 { 363 b.HasOne("FarmatikoData.Models.PharmacyHead", null) 364 .WithMany("PharmaciesList") 365 .HasForeignKey("PharmacyHeadId"); 370 b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") 371 .WithMany("PHMedicineList") 372 .HasForeignKey("PheadId") 373 .OnDelete(DeleteBehavior.Cascade) 374 .IsRequired(); 366 375 }); 367 376
Note:
See TracChangeset
for help on using the changeset viewer.