diff --git a/PyroFetes/Migrations/20251007094021_InitialDatabase.Designer.cs b/PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
similarity index 71%
rename from PyroFetes/Migrations/20251007094021_InitialDatabase.Designer.cs
rename to PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
index 7b2ce88..8e971b2 100644
--- a/PyroFetes/Migrations/20251007094021_InitialDatabase.Designer.cs
+++ b/PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
@@ -12,7 +12,7 @@ using PyroFetes;
namespace PyroFetes.Migrations
{
[DbContext(typeof(PyroFetesDbContext))]
- [Migration("20251007094021_InitialDatabase")]
+ [Migration("20251008103414_InitialDatabase")]
partial class InitialDatabase
{
///
@@ -33,9 +33,8 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
- b.Property("AvailabilityDate")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
+ b.Property("AvailabilityDate")
+ .HasColumnType("date");
b.Property("DeliveryDate")
.HasColumnType("date");
@@ -74,6 +73,27 @@ namespace PyroFetes.Migrations
b.ToTable("Brands");
});
+ modelBuilder.Entity("PyroFetes.Models.City", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ZipCode")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("City");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Classification", b =>
{
b.Property("Id")
@@ -84,7 +104,8 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -101,7 +122,8 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -118,18 +140,26 @@ namespace PyroFetes.Migrations
b.Property("Calling")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ContactId")
+ .HasColumnType("int");
b.Property("Email")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Meeting")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)");
b.HasKey("Id");
+ b.HasIndex("ContactId");
+
b.ToTable("Communications");
});
@@ -143,18 +173,21 @@ namespace PyroFetes.Migrations
b.Property("Address")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("City")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
- b.Property("CommunicationId")
+ b.Property("CustomerId")
.HasColumnType("int");
b.Property("Email")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("FirstName")
.IsRequired()
@@ -168,23 +201,58 @@ namespace PyroFetes.Migrations
b.Property("PhoneNumber")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
b.Property("Role")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
- b.Property("ZipCode")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
+ b.Property("ZipCode")
+ .HasColumnType("int");
b.HasKey("Id");
- b.HasIndex("CommunicationId");
+ b.HasIndex("CustomerId");
b.ToTable("Contacts");
});
+ modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b =>
+ {
+ b.Property("ContactId")
+ .HasColumnType("int");
+
+ b.Property("ServiceProviderId")
+ .HasColumnType("int");
+
+ b.HasKey("ContactId", "ServiceProviderId");
+
+ b.HasIndex("ServiceProviderId");
+
+ b.ToTable("ContactServiceProvider");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Contract", b =>
+ {
+ b.Property("ShowId")
+ .HasColumnType("int");
+
+ b.Property("ServiceProviderId")
+ .HasColumnType("int");
+
+ b.Property("TermsAndConditions")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("ShowId", "ServiceProviderId");
+
+ b.HasIndex("ServiceProviderId");
+
+ b.ToTable("Contract");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Customer", b =>
{
b.Property("Id")
@@ -193,40 +261,21 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
- b.Property("ContactId")
- .HasColumnType("int");
-
b.Property("CustomerTypeId")
.HasColumnType("int");
b.Property("Note")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
b.HasKey("Id");
- b.HasIndex("ContactId");
-
b.HasIndex("CustomerTypeId");
b.ToTable("Customers");
});
- modelBuilder.Entity("PyroFetes.Models.CustomerContact", b =>
- {
- b.Property("ContactId")
- .HasColumnType("int");
-
- b.Property("CustomerId")
- .HasColumnType("int");
-
- b.HasKey("ContactId", "CustomerId");
-
- b.HasIndex("CustomerId");
-
- b.ToTable("CustomerContacts");
- });
-
modelBuilder.Entity("PyroFetes.Models.CustomerType", b =>
{
b.Property("Id")
@@ -235,8 +284,10 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
- b.Property("Price")
- .HasColumnType("decimal(18,2)");
+ b.Property("Label")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -253,7 +304,8 @@ namespace PyroFetes.Migrations
b.Property("Transporter")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -282,7 +334,8 @@ namespace PyroFetes.Migrations
b.Property("TrackingNumber")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -301,7 +354,8 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
b.HasKey("Id");
@@ -318,10 +372,16 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("StaffId")
+ .HasColumnType("int");
b.HasKey("Id");
+ b.HasIndex("StaffId");
+
b.ToTable("ExperienceLevels");
});
@@ -370,6 +430,21 @@ namespace PyroFetes.Migrations
b.ToTable("Materials");
});
+ modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b =>
+ {
+ b.Property("MaterialId")
+ .HasColumnType("int");
+
+ b.Property("WarehouseId")
+ .HasColumnType("int");
+
+ b.HasKey("MaterialId", "WarehouseId");
+
+ b.HasIndex("WarehouseId");
+
+ b.ToTable("MaterialWarehouse");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Movement", b =>
{
b.Property("Id")
@@ -387,9 +462,6 @@ namespace PyroFetes.Migrations
b.Property("DestinationWarehouseId")
.HasColumnType("int");
- b.Property("ProductId")
- .HasColumnType("int");
-
b.Property("Quantity")
.HasColumnType("int");
@@ -403,8 +475,6 @@ namespace PyroFetes.Migrations
b.HasIndex("DestinationWarehouseId");
- b.HasIndex("ProductId");
-
b.HasIndex("SourceWarehouseId");
b.ToTable("Movements");
@@ -454,11 +524,15 @@ namespace PyroFetes.Migrations
b.Property("Link")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
b.Property("MinimalQuantity")
.HasColumnType("int");
+ b.Property("MovementId")
+ .HasColumnType("int");
+
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
@@ -483,6 +557,8 @@ namespace PyroFetes.Migrations
b.HasIndex("ClassificationId");
+ b.HasIndex("MovementId");
+
b.HasIndex("ProductCategoryId");
b.ToTable("Products");
@@ -498,7 +574,8 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -553,28 +630,25 @@ namespace PyroFetes.Migrations
b.ToTable("ProductEffects");
});
- modelBuilder.Entity("PyroFetes.Models.Provider", b =>
+ modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b =>
{
- b.Property("Id")
- .ValueGeneratedOnAdd()
+ b.Property("ProductId")
.HasColumnType("int");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ b.Property("ShowId")
+ .HasColumnType("int");
- b.Property("Price")
+ b.Property("End")
.HasColumnType("decimal(18,2)");
- b.Property("ProviderId")
- .HasColumnType("int");
+ b.Property("Start")
+ .HasColumnType("decimal(18,2)");
- b.Property("ProviderTypeId")
- .HasColumnType("int");
+ b.HasKey("ProductId", "ShowId");
- b.HasKey("Id");
+ b.HasIndex("ShowId");
- b.HasIndex("ProviderTypeId");
-
- b.ToTable("Providers");
+ b.ToTable("ProductTimecode");
});
modelBuilder.Entity("PyroFetes.Models.ProviderContact", b =>
@@ -602,7 +676,8 @@ namespace PyroFetes.Migrations
b.Property("Label")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -619,7 +694,8 @@ namespace PyroFetes.Migrations
b.Property("PurchaseConditions")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)");
b.HasKey("Id");
@@ -654,14 +730,21 @@ namespace PyroFetes.Migrations
b.Property("ConditionsSale")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
b.Property("Message")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
b.HasKey("Id");
+ b.HasIndex("CustomerId");
+
b.ToTable("Quotations");
});
@@ -683,6 +766,27 @@ namespace PyroFetes.Migrations
b.ToTable("QuotationProducts");
});
+ modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ProviderTypeId")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProviderTypeId");
+
+ b.ToTable("Providers");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Setting", b =>
{
b.Property("Id")
@@ -712,8 +816,11 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
- b.Property("Date")
- .HasColumnType("datetime2");
+ b.Property("CityId")
+ .HasColumnType("int");
+
+ b.Property("Date")
+ .HasColumnType("date");
b.Property("Description")
.HasMaxLength(500)
@@ -721,7 +828,8 @@ namespace PyroFetes.Migrations
b.Property("Name")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Place")
.IsRequired()
@@ -735,9 +843,56 @@ namespace PyroFetes.Migrations
b.HasKey("Id");
+ b.HasIndex("CityId");
+
b.ToTable("Shows");
});
+ modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b =>
+ {
+ b.Property("ShowId")
+ .HasColumnType("int");
+
+ b.Property("MaterialId")
+ .HasColumnType("int");
+
+ b.HasKey("ShowId", "MaterialId");
+
+ b.HasIndex("MaterialId");
+
+ b.ToTable("ShowMaterial");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ShowStaff", b =>
+ {
+ b.Property("StaffId")
+ .HasColumnType("int");
+
+ b.Property("ShowId")
+ .HasColumnType("int");
+
+ b.HasKey("StaffId", "ShowId");
+
+ b.HasIndex("ShowId");
+
+ b.ToTable("ShowStaff");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ShowTruck", b =>
+ {
+ b.Property("ShowId")
+ .HasColumnType("int");
+
+ b.Property("TruckId")
+ .HasColumnType("int");
+
+ b.HasKey("ShowId", "TruckId");
+
+ b.HasIndex("TruckId");
+
+ b.ToTable("ShowTruck");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Sound", b =>
{
b.Property("Id")
@@ -798,8 +953,8 @@ namespace PyroFetes.Migrations
b.Property("Name")
.IsRequired()
- .HasMaxLength(60)
- .HasColumnType("nvarchar(60)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -808,27 +963,19 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b =>
{
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("End")
- .HasColumnType("int");
-
b.Property("ShowId")
.HasColumnType("int");
b.Property("SoundId")
.HasColumnType("int");
- b.Property("Start")
- .HasColumnType("int");
+ b.Property("End")
+ .HasColumnType("decimal(18,2)");
- b.HasKey("Id");
+ b.Property("Start")
+ .HasColumnType("decimal(18,2)");
- b.HasIndex("ShowId");
+ b.HasKey("ShowId", "SoundId");
b.HasIndex("SoundId");
@@ -853,7 +1000,8 @@ namespace PyroFetes.Migrations
b.Property("F4T2NumberApproval")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("FirstName")
.IsRequired()
@@ -930,18 +1078,21 @@ namespace PyroFetes.Migrations
b.Property("Address")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("City")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("DeliveryDelay")
.HasColumnType("int");
b.Property("Email")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Name")
.IsRequired()
@@ -950,7 +1101,8 @@ namespace PyroFetes.Migrations
b.Property("Phone")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
b.Property("ZipCode")
.HasColumnType("int");
@@ -969,11 +1121,9 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("MaxExplosiveCapacity")
+ .IsRequired()
.HasColumnType("float");
- b.Property("ShowId")
- .HasColumnType("int");
-
b.Property("Sizes")
.IsRequired()
.HasMaxLength(80)
@@ -991,8 +1141,6 @@ namespace PyroFetes.Migrations
b.HasKey("Id");
- b.HasIndex("ShowId");
-
b.ToTable("Trucks");
});
@@ -1006,11 +1154,13 @@ namespace PyroFetes.Migrations
b.Property("Email")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Fonction")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Name")
.IsRequired()
@@ -1019,11 +1169,13 @@ namespace PyroFetes.Migrations
b.Property("Password")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
b.Property("Salt")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.HasKey("Id");
@@ -1040,11 +1192,13 @@ namespace PyroFetes.Migrations
b.Property("Address")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("City")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
b.Property("Current")
.HasColumnType("int");
@@ -1070,42 +1224,22 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b =>
{
- b.Property("Quantity")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Quantity"));
-
b.Property("ProductId")
.HasColumnType("int");
b.Property("WarehouseId")
.HasColumnType("int");
- b.HasKey("Quantity");
+ b.Property("Quantity")
+ .HasColumnType("int");
- b.HasIndex("ProductId");
+ b.HasKey("ProductId", "WarehouseId");
b.HasIndex("WarehouseId");
b.ToTable("WarehouseProducts");
});
- modelBuilder.Entity("ShowStaff", b =>
- {
- b.Property("ShowsId")
- .HasColumnType("int");
-
- b.Property("StaffId")
- .HasColumnType("int");
-
- b.HasKey("ShowsId", "StaffId");
-
- b.HasIndex("StaffId");
-
- b.ToTable("ShowStaff");
- });
-
modelBuilder.Entity("PyroFetes.Models.Brand", b =>
{
b.HasOne("PyroFetes.Models.Product", "Product")
@@ -1117,55 +1251,77 @@ namespace PyroFetes.Migrations
b.Navigation("Product");
});
- modelBuilder.Entity("PyroFetes.Models.Contact", b =>
- {
- b.HasOne("PyroFetes.Models.Communication", "Communication")
- .WithMany()
- .HasForeignKey("CommunicationId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Communication");
- });
-
- modelBuilder.Entity("PyroFetes.Models.Customer", b =>
+ modelBuilder.Entity("PyroFetes.Models.Communication", b =>
{
b.HasOne("PyroFetes.Models.Contact", "Contact")
- .WithMany()
+ .WithMany("Communications")
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
+ b.Navigation("Contact");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Contact", b =>
+ {
+ b.HasOne("PyroFetes.Models.Customer", "Customer")
+ .WithMany("Contacts")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b =>
+ {
+ b.HasOne("PyroFetes.Models.Contact", "Contact")
+ .WithMany("ContactServiceProviders")
+ .HasForeignKey("ContactId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider")
+ .WithMany("ContactServiceProviders")
+ .HasForeignKey("ServiceProviderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Contact");
+
+ b.Navigation("ServiceProvider");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Contract", b =>
+ {
+ b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider")
+ .WithMany("Contracts")
+ .HasForeignKey("ServiceProviderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.Show", "Show")
+ .WithMany("Contracts")
+ .HasForeignKey("ShowId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ServiceProvider");
+
+ b.Navigation("Show");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Customer", b =>
+ {
b.HasOne("PyroFetes.Models.CustomerType", "CustomerType")
.WithMany("Customers")
.HasForeignKey("CustomerTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.Navigation("Contact");
-
b.Navigation("CustomerType");
});
- modelBuilder.Entity("PyroFetes.Models.CustomerContact", b =>
- {
- b.HasOne("PyroFetes.Models.Contact", "Contact")
- .WithMany("CustomerContacts")
- .HasForeignKey("ContactId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.HasOne("PyroFetes.Models.Customer", "Customer")
- .WithMany("CustomerContacts")
- .HasForeignKey("CustomerId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("Contact");
-
- b.Navigation("Customer");
- });
-
modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b =>
{
b.HasOne("PyroFetes.Models.Deliverer", "Deliverer")
@@ -1177,10 +1333,21 @@ namespace PyroFetes.Migrations
b.Navigation("Deliverer");
});
+ modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b =>
+ {
+ b.HasOne("PyroFetes.Models.Staff", "Staff")
+ .WithMany("ExperienceLevels")
+ .HasForeignKey("StaffId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Staff");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Material", b =>
{
b.HasOne("PyroFetes.Models.Warehouse", "Warehouse")
- .WithMany("Materials")
+ .WithMany()
.HasForeignKey("WarehouseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1188,6 +1355,25 @@ namespace PyroFetes.Migrations
b.Navigation("Warehouse");
});
+ modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b =>
+ {
+ b.HasOne("PyroFetes.Models.Material", "Material")
+ .WithMany("MaterialWarehouses")
+ .HasForeignKey("MaterialId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.Warehouse", "Warehouse")
+ .WithMany("MaterialWarehouses")
+ .HasForeignKey("WarehouseId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("Material");
+
+ b.Navigation("Warehouse");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Movement", b =>
{
b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse")
@@ -1195,12 +1381,6 @@ namespace PyroFetes.Migrations
.HasForeignKey("DestinationWarehouseId")
.OnDelete(DeleteBehavior.Restrict);
- b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany("Movements")
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse")
.WithMany("MovementsSource")
.HasForeignKey("SourceWarehouseId")
@@ -1208,21 +1388,19 @@ namespace PyroFetes.Migrations
b.Navigation("DestinationWarehouse");
- b.Navigation("Product");
-
b.Navigation("SourceWarehouse");
});
modelBuilder.Entity("PyroFetes.Models.Price", b =>
{
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("Prices")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Supplier", "Supplier")
- .WithMany()
+ .WithMany("Prices")
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1240,6 +1418,12 @@ namespace PyroFetes.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
+ b.HasOne("PyroFetes.Models.Movement", "Movement")
+ .WithMany("Products")
+ .HasForeignKey("MovementId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory")
.WithMany("Products")
.HasForeignKey("ProductCategoryId")
@@ -1248,19 +1432,21 @@ namespace PyroFetes.Migrations
b.Navigation("Classification");
+ b.Navigation("Movement");
+
b.Navigation("ProductCategory");
});
modelBuilder.Entity("PyroFetes.Models.ProductColor", b =>
{
b.HasOne("PyroFetes.Models.Color", "Color")
- .WithMany()
+ .WithMany("ProductColors")
.HasForeignKey("ColorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("ProductColors")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1273,13 +1459,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b =>
{
b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote")
- .WithMany()
+ .WithMany("ProductDeliveries")
.HasForeignKey("DeliveryNoteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("ProductDeliveries")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1292,13 +1478,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.ProductEffect", b =>
{
b.HasOne("PyroFetes.Models.Effect", "Effect")
- .WithMany()
+ .WithMany("ProductEffects")
.HasForeignKey("EffectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("ProductEffects")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1308,13 +1494,23 @@ namespace PyroFetes.Migrations
b.Navigation("Product");
});
- modelBuilder.Entity("PyroFetes.Models.Provider", b =>
+ modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b =>
{
- b.HasOne("PyroFetes.Models.ProviderType", "ProviderType")
- .WithMany()
- .HasForeignKey("ProviderTypeId");
+ b.HasOne("PyroFetes.Models.Product", "Product")
+ .WithMany("ProductTimecodes")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
- b.Navigation("ProviderType");
+ b.HasOne("PyroFetes.Models.Show", "Show")
+ .WithMany("ProductTimecodes")
+ .HasForeignKey("ShowId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Product");
+
+ b.Navigation("Show");
});
modelBuilder.Entity("PyroFetes.Models.ProviderContact", b =>
@@ -1325,7 +1521,7 @@ namespace PyroFetes.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("PyroFetes.Models.Provider", "Provider")
+ b.HasOne("PyroFetes.Models.ServiceProvider", "Provider")
.WithMany()
.HasForeignKey("ProviderId")
.OnDelete(DeleteBehavior.Cascade)
@@ -1339,13 +1535,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b =>
{
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("PurchaseProducts")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder")
- .WithMany()
+ .WithMany("PurchaseProducts")
.HasForeignKey("PurchaseOrderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1355,16 +1551,27 @@ namespace PyroFetes.Migrations
b.Navigation("PurchaseOrder");
});
+ modelBuilder.Entity("PyroFetes.Models.Quotation", b =>
+ {
+ b.HasOne("PyroFetes.Models.Customer", "Customer")
+ .WithMany("Quotations")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b =>
{
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("QuotationProducts")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Quotation", "Quotation")
- .WithMany()
+ .WithMany("QuotationProducts")
.HasForeignKey("QuotationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1374,27 +1581,106 @@ namespace PyroFetes.Migrations
b.Navigation("Quotation");
});
+ modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b =>
+ {
+ b.HasOne("PyroFetes.Models.ProviderType", "ProviderType")
+ .WithMany("ServiceProviders")
+ .HasForeignKey("ProviderTypeId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ProviderType");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Show", b =>
+ {
+ b.HasOne("PyroFetes.Models.City", "City")
+ .WithMany("Shows")
+ .HasForeignKey("CityId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("City");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b =>
+ {
+ b.HasOne("PyroFetes.Models.Material", "Material")
+ .WithMany("ShowMaterials")
+ .HasForeignKey("MaterialId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.Show", "Show")
+ .WithMany("ShowMaterials")
+ .HasForeignKey("ShowId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Material");
+
+ b.Navigation("Show");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ShowStaff", b =>
+ {
+ b.HasOne("PyroFetes.Models.Show", "Show")
+ .WithMany("ShowStaffs")
+ .HasForeignKey("ShowId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.Staff", "Staff")
+ .WithMany("ShowStaffs")
+ .HasForeignKey("StaffId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Show");
+
+ b.Navigation("Staff");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ShowTruck", b =>
+ {
+ b.HasOne("PyroFetes.Models.Show", "Show")
+ .WithMany("ShowTrucks")
+ .HasForeignKey("ShowId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("PyroFetes.Models.Truck", "Truck")
+ .WithMany("ShowTrucks")
+ .HasForeignKey("TruckId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Show");
+
+ b.Navigation("Truck");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Sound", b =>
{
- b.HasOne("PyroFetes.Models.SoundCategory", "Category")
+ b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory")
.WithMany("Sounds")
.HasForeignKey("SoundCategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.Navigation("Category");
+ b.Navigation("SoundCategory");
});
modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b =>
{
b.HasOne("PyroFetes.Models.Show", "Show")
- .WithMany("SoundCues")
+ .WithMany("SoundTimecodes")
.HasForeignKey("ShowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Sound", "Sound")
- .WithMany("ShowPlacements")
+ .WithMany("SoundTimecodes")
.HasForeignKey("SoundId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1407,13 +1693,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b =>
{
b.HasOne("PyroFetes.Models.Availability", "Availability")
- .WithMany()
+ .WithMany("StaffAvailabilities")
.HasForeignKey("AvailabilityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Staff", "Staff")
- .WithMany()
+ .WithMany("StaffAvailabilities")
.HasForeignKey("StaffId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1426,13 +1712,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.StaffContact", b =>
{
b.HasOne("PyroFetes.Models.Contact", "Contact")
- .WithMany()
+ .WithMany("StaffContacts")
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Staff", "Staff")
- .WithMany()
+ .WithMany("StaffContacts")
.HasForeignKey("StaffId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1445,13 +1731,13 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b =>
{
b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval")
- .WithMany()
+ .WithMany("StaffHistoryOfApprovals")
.HasForeignKey("HistoryOfApprovalId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Staff", "Staff")
- .WithMany()
+ .WithMany("StaffHistoryOfApprovals")
.HasForeignKey("StaffId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1461,27 +1747,16 @@ namespace PyroFetes.Migrations
b.Navigation("Staff");
});
- modelBuilder.Entity("PyroFetes.Models.Truck", b =>
- {
- b.HasOne("PyroFetes.Models.Show", "Show")
- .WithMany("Trucks")
- .HasForeignKey("ShowId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Show");
- });
-
modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b =>
{
b.HasOne("PyroFetes.Models.Product", "Product")
- .WithMany()
+ .WithMany("WarehouseProducts")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Warehouse", "Warehouse")
- .WithMany()
+ .WithMany("WarehouseProducts")
.HasForeignKey("WarehouseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1491,19 +1766,14 @@ namespace PyroFetes.Migrations
b.Navigation("Warehouse");
});
- modelBuilder.Entity("ShowStaff", b =>
+ modelBuilder.Entity("PyroFetes.Models.Availability", b =>
{
- b.HasOne("PyroFetes.Models.Show", null)
- .WithMany()
- .HasForeignKey("ShowsId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ b.Navigation("StaffAvailabilities");
+ });
- b.HasOne("PyroFetes.Models.Staff", null)
- .WithMany()
- .HasForeignKey("StaffId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ modelBuilder.Entity("PyroFetes.Models.City", b =>
+ {
+ b.Navigation("Shows");
});
modelBuilder.Entity("PyroFetes.Models.Classification", b =>
@@ -1511,14 +1781,25 @@ namespace PyroFetes.Migrations
b.Navigation("Products");
});
+ modelBuilder.Entity("PyroFetes.Models.Color", b =>
+ {
+ b.Navigation("ProductColors");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Contact", b =>
{
- b.Navigation("CustomerContacts");
+ b.Navigation("Communications");
+
+ b.Navigation("ContactServiceProviders");
+
+ b.Navigation("StaffContacts");
});
modelBuilder.Entity("PyroFetes.Models.Customer", b =>
{
- b.Navigation("CustomerContacts");
+ b.Navigation("Contacts");
+
+ b.Navigation("Quotations");
});
modelBuilder.Entity("PyroFetes.Models.CustomerType", b =>
@@ -1531,11 +1812,52 @@ namespace PyroFetes.Migrations
b.Navigation("DeliveryNotes");
});
+ modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b =>
+ {
+ b.Navigation("ProductDeliveries");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Effect", b =>
+ {
+ b.Navigation("ProductEffects");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b =>
+ {
+ b.Navigation("StaffHistoryOfApprovals");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Material", b =>
+ {
+ b.Navigation("MaterialWarehouses");
+
+ b.Navigation("ShowMaterials");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Movement", b =>
+ {
+ b.Navigation("Products");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Product", b =>
{
b.Navigation("Brands");
- b.Navigation("Movements");
+ b.Navigation("Prices");
+
+ b.Navigation("ProductColors");
+
+ b.Navigation("ProductDeliveries");
+
+ b.Navigation("ProductEffects");
+
+ b.Navigation("ProductTimecodes");
+
+ b.Navigation("PurchaseProducts");
+
+ b.Navigation("QuotationProducts");
+
+ b.Navigation("WarehouseProducts");
});
modelBuilder.Entity("PyroFetes.Models.ProductCategory", b =>
@@ -1543,16 +1865,46 @@ namespace PyroFetes.Migrations
b.Navigation("Products");
});
+ modelBuilder.Entity("PyroFetes.Models.ProviderType", b =>
+ {
+ b.Navigation("ServiceProviders");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b =>
+ {
+ b.Navigation("PurchaseProducts");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Quotation", b =>
+ {
+ b.Navigation("QuotationProducts");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b =>
+ {
+ b.Navigation("ContactServiceProviders");
+
+ b.Navigation("Contracts");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Show", b =>
{
- b.Navigation("SoundCues");
+ b.Navigation("Contracts");
- b.Navigation("Trucks");
+ b.Navigation("ProductTimecodes");
+
+ b.Navigation("ShowMaterials");
+
+ b.Navigation("ShowStaffs");
+
+ b.Navigation("ShowTrucks");
+
+ b.Navigation("SoundTimecodes");
});
modelBuilder.Entity("PyroFetes.Models.Sound", b =>
{
- b.Navigation("ShowPlacements");
+ b.Navigation("SoundTimecodes");
});
modelBuilder.Entity("PyroFetes.Models.SoundCategory", b =>
@@ -1560,13 +1912,38 @@ namespace PyroFetes.Migrations
b.Navigation("Sounds");
});
+ modelBuilder.Entity("PyroFetes.Models.Staff", b =>
+ {
+ b.Navigation("ExperienceLevels");
+
+ b.Navigation("ShowStaffs");
+
+ b.Navigation("StaffAvailabilities");
+
+ b.Navigation("StaffContacts");
+
+ b.Navigation("StaffHistoryOfApprovals");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Supplier", b =>
+ {
+ b.Navigation("Prices");
+ });
+
+ modelBuilder.Entity("PyroFetes.Models.Truck", b =>
+ {
+ b.Navigation("ShowTrucks");
+ });
+
modelBuilder.Entity("PyroFetes.Models.Warehouse", b =>
{
- b.Navigation("Materials");
+ b.Navigation("MaterialWarehouses");
b.Navigation("MovementsDestination");
b.Navigation("MovementsSource");
+
+ b.Navigation("WarehouseProducts");
});
#pragma warning restore 612, 618
}
diff --git a/PyroFetes/Migrations/20251007094021_InitialDatabase.cs b/PyroFetes/Migrations/20251008103414_InitialDatabase.cs
similarity index 79%
rename from PyroFetes/Migrations/20251007094021_InitialDatabase.cs
rename to PyroFetes/Migrations/20251008103414_InitialDatabase.cs
index 0d226b1..5c5dbc7 100644
--- a/PyroFetes/Migrations/20251007094021_InitialDatabase.cs
+++ b/PyroFetes/Migrations/20251008103414_InitialDatabase.cs
@@ -17,7 +17,7 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- AvailabilityDate = table.Column(type: "nvarchar(max)", nullable: false),
+ AvailabilityDate = table.Column(type: "date", nullable: false),
DeliveryDate = table.Column(type: "date", nullable: false),
ExpirationDate = table.Column(type: "date", nullable: false),
RenewallDate = table.Column(type: "date", nullable: false)
@@ -27,13 +27,27 @@ namespace PyroFetes.Migrations
table.PrimaryKey("PK_Availabilities", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "City",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ ZipCode = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_City", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "Classifications",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
+ Label = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -46,35 +60,20 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
+ Label = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Colors", x => x.Id);
});
- migrationBuilder.CreateTable(
- name: "Communications",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Calling = table.Column(type: "nvarchar(max)", nullable: false),
- Email = table.Column(type: "nvarchar(max)", nullable: false),
- Meeting = table.Column(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Communications", x => x.Id);
- });
-
migrationBuilder.CreateTable(
name: "CustomerTypes",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Price = table.Column(type: "decimal(18,2)", nullable: false)
+ Label = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -87,7 +86,7 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Transporter = table.Column(type: "nvarchar(max)", nullable: false)
+ Transporter = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -100,34 +99,21 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
+ Label = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Effects", x => x.Id);
});
- migrationBuilder.CreateTable(
- name: "ExperienceLevels",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ExperienceLevels", x => x.Id);
- });
-
migrationBuilder.CreateTable(
name: "HistoryOfApprovals",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- ExpirationDate = table.Column(type: "date", nullable: false),
- DeliveryDate = table.Column(type: "date", nullable: false)
+ DeliveryDate = table.Column(type: "date", nullable: false),
+ ExpirationDate = table.Column(type: "date", nullable: false)
},
constraints: table =>
{
@@ -140,7 +126,7 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
+ Label = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -153,7 +139,7 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Label = table.Column(type: "nvarchar(max)", nullable: false)
+ Label = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -166,27 +152,13 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- PurchaseConditions = table.Column(type: "nvarchar(max)", nullable: false)
+ PurchaseConditions = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PurchaseOrders", x => x.Id);
});
- migrationBuilder.CreateTable(
- name: "Quotations",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Message = table.Column(type: "nvarchar(max)", nullable: false),
- ConditionsSale = table.Column(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Quotations", x => x.Id);
- });
-
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
@@ -201,30 +173,13 @@ namespace PyroFetes.Migrations
table.PrimaryKey("PK_Settings", x => x.Id);
});
- migrationBuilder.CreateTable(
- name: "Shows",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column(type: "nvarchar(max)", nullable: false),
- Place = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false),
- Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
- PyrotechnicImplementationPlan = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false),
- Date = table.Column(type: "datetime2", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Shows", x => x.Id);
- });
-
migrationBuilder.CreateTable(
name: "SoundCategories",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false)
+ Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -241,7 +196,7 @@ namespace PyroFetes.Migrations
LastName = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false),
Profession = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Email = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false),
- F4T2NumberApproval = table.Column(type: "nvarchar(max)", nullable: false),
+ F4T2NumberApproval = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
F4T2ExpirationDate = table.Column(type: "date", nullable: false)
},
constraints: table =>
@@ -256,11 +211,11 @@ namespace PyroFetes.Migrations
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Email = table.Column(type: "nvarchar(max)", nullable: false),
- Phone = table.Column(type: "nvarchar(max)", nullable: false),
- Address = table.Column(type: "nvarchar(max)", nullable: false),
+ Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ Phone = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false),
+ Address = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
ZipCode = table.Column(type: "int", nullable: false),
- City = table.Column(type: "nvarchar(max)", nullable: false),
+ City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
DeliveryDelay = table.Column(type: "int", nullable: false)
},
constraints: table =>
@@ -268,6 +223,22 @@ namespace PyroFetes.Migrations
table.PrimaryKey("PK_Suppliers", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "Trucks",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Type = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
+ MaxExplosiveCapacity = table.Column(type: "float", nullable: false),
+ Sizes = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: false),
+ Status = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Trucks", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
@@ -275,10 +246,10 @@ namespace PyroFetes.Migrations
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Password = table.Column(type: "nvarchar(max)", nullable: false),
- Salt = table.Column(type: "nvarchar(max)", nullable: false),
- Email = table.Column(type: "nvarchar(max)", nullable: false),
- Fonction = table.Column(type: "nvarchar(max)", nullable: false)
+ Password = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ Salt = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ Fonction = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -295,9 +266,9 @@ namespace PyroFetes.Migrations
MaxWeight = table.Column(type: "int", nullable: false),
Current = table.Column(type: "int", nullable: false),
MinWeight = table.Column(type: "int", nullable: false),
- Address = table.Column(type: "nvarchar(max)", nullable: false),
+ Address = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
ZipCode = table.Column(type: "int", nullable: false),
- City = table.Column(type: "nvarchar(max)", nullable: false)
+ City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
},
constraints: table =>
{
@@ -305,28 +276,45 @@ namespace PyroFetes.Migrations
});
migrationBuilder.CreateTable(
- name: "Contacts",
+ name: "Shows",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Email = table.Column(type: "nvarchar(max)", nullable: false),
- PhoneNumber = table.Column(type: "nvarchar(max)", nullable: false),
- Address = table.Column(type: "nvarchar(max)", nullable: false),
- ZipCode = table.Column(type: "nvarchar(max)", nullable: false),
- City = table.Column(type: "nvarchar(max)", nullable: false),
- Role = table.Column(type: "nvarchar(max)", nullable: false),
- CommunicationId = table.Column(type: "int", nullable: false)
+ Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ Place = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false),
+ Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
+ Date = table.Column(type: "date", nullable: true),
+ PyrotechnicImplementationPlan = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false),
+ CityId = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
- table.PrimaryKey("PK_Contacts", x => x.Id);
+ table.PrimaryKey("PK_Shows", x => x.Id);
table.ForeignKey(
- name: "FK_Contacts_Communications_CommunicationId",
- column: x => x.CommunicationId,
- principalTable: "Communications",
+ name: "FK_Shows_City_CityId",
+ column: x => x.CityId,
+ principalTable: "City",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Customers",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Note = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
+ CustomerTypeId = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Customers", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Customers_CustomerTypes_CustomerTypeId",
+ column: x => x.CustomerTypeId,
+ principalTable: "CustomerTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
@@ -337,7 +325,7 @@ namespace PyroFetes.Migrations
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
- TrackingNumber = table.Column(type: "nvarchar(max)", nullable: false),
+ TrackingNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
DelivererId = table.Column(type: "int", nullable: false),
EstimateDeliveryDate = table.Column(type: "date", nullable: false),
ExpeditionDate = table.Column(type: "date", nullable: false),
@@ -354,43 +342,6 @@ namespace PyroFetes.Migrations
onDelete: ReferentialAction.Cascade);
});
- migrationBuilder.CreateTable(
- name: "Products",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- References = table.Column(type: "int", nullable: false),
- Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Duration = table.Column(type: "decimal(18,2)", nullable: false),
- Caliber = table.Column(type: "decimal(18,2)", nullable: false),
- ApprovalNumber = table.Column