// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using backend.Data; #nullable disable namespace backend.Migrations { [DbContext(typeof(DataContext))] [Migration("20220808143343_Auth-changes")] partial class Authchanges { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "6.0.3") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("backend.Entities.MenuItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Description") .IsRequired() .HasColumnType("text"); b.Property("Price") .HasColumnType("integer"); b.Property("RestaurantId") .HasColumnType("integer"); b.Property("Title") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("RestaurantId"); b.ToTable("MenuItems"); }); modelBuilder.Entity("backend.Entities.Reservation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ContactName") .IsRequired() .HasColumnType("text"); b.Property("ContactNumber") .IsRequired() .HasColumnType("text"); b.Property("Persons") .HasColumnType("integer"); b.Property("ReservationPlace") .HasColumnType("integer"); b.Property("ReservationStatus") .HasColumnType("integer"); b.Property("ReservationType") .HasColumnType("integer"); b.Property("RestaurantId") .HasColumnType("integer"); b.Property("StartDate") .HasColumnType("timestamp with time zone"); b.Property("Table") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("RestaurantId"); b.ToTable("Reservations"); }); modelBuilder.Entity("backend.Entities.Restaurant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Address") .IsRequired() .HasColumnType("text"); b.Property("Image") .IsRequired() .HasColumnType("bytea"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("OwnerFk") .HasColumnType("integer"); b.Property("Phone") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("OwnerFk") .IsUnique(); b.ToTable("Restoraunts"); }); modelBuilder.Entity("backend.Entities.Review", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .IsRequired() .HasColumnType("text"); b.Property("RestaurantId") .HasColumnType("integer"); b.Property("Stars") .HasColumnType("integer"); b.Property("Title") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("RestaurantId"); b.HasIndex("UserId"); b.ToTable("Reviews"); }); modelBuilder.Entity("backend.Entities.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ConfirmationURL") .IsRequired() .HasColumnType("text"); b.Property("ConfirmationValidTo") .HasColumnType("timestamp with time zone"); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("IsAdmin") .HasColumnType("boolean"); b.Property("IsConfirmed") .HasColumnType("boolean"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.Property("PasswordResetURL") .IsRequired() .HasColumnType("text"); b.Property("PasswordResetValidTo") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("backend.Entities.MenuItem", b => { b.HasOne("backend.Entities.Restaurant", "Restaurant") .WithMany("Menu") .HasForeignKey("RestaurantId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Restaurant"); }); modelBuilder.Entity("backend.Entities.Reservation", b => { b.HasOne("backend.Entities.Restaurant", "Restaurant") .WithMany("Reservations") .HasForeignKey("RestaurantId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Restaurant"); }); modelBuilder.Entity("backend.Entities.Restaurant", b => { b.HasOne("backend.Entities.User", "Owner") .WithOne("Restaurant") .HasForeignKey("backend.Entities.Restaurant", "OwnerFk"); b.Navigation("Owner"); }); modelBuilder.Entity("backend.Entities.Review", b => { b.HasOne("backend.Entities.Restaurant", "Restaurant") .WithMany("Reviews") .HasForeignKey("RestaurantId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("backend.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Restaurant"); b.Navigation("User"); }); modelBuilder.Entity("backend.Entities.Restaurant", b => { b.Navigation("Menu"); b.Navigation("Reservations"); b.Navigation("Reviews"); }); modelBuilder.Entity("backend.Entities.User", b => { b.Navigation("Restaurant") .IsRequired(); }); #pragma warning restore 612, 618 } } }