[b66b3ac] | 1 | // <auto-generated />
|
---|
| 2 | using System;
|
---|
| 3 | using Microsoft.EntityFrameworkCore;
|
---|
| 4 | using Microsoft.EntityFrameworkCore.Infrastructure;
|
---|
| 5 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
---|
| 6 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
---|
| 7 | using backend.Data;
|
---|
| 8 |
|
---|
| 9 | #nullable disable
|
---|
| 10 |
|
---|
| 11 | namespace backend.Migrations
|
---|
| 12 | {
|
---|
| 13 | [DbContext(typeof(DataContext))]
|
---|
| 14 | partial class DataContextModelSnapshot : ModelSnapshot
|
---|
| 15 | {
|
---|
| 16 | protected override void BuildModel(ModelBuilder modelBuilder)
|
---|
| 17 | {
|
---|
| 18 | #pragma warning disable 612, 618
|
---|
| 19 | modelBuilder
|
---|
| 20 | .HasAnnotation("ProductVersion", "6.0.3")
|
---|
| 21 | .HasAnnotation("Relational:MaxIdentifierLength", 63);
|
---|
| 22 |
|
---|
| 23 | NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
---|
| 24 |
|
---|
| 25 | modelBuilder.Entity("backend.Entities.Reservation", b =>
|
---|
| 26 | {
|
---|
| 27 | b.Property<int>("Id")
|
---|
| 28 | .ValueGeneratedOnAdd()
|
---|
| 29 | .HasColumnType("integer");
|
---|
| 30 |
|
---|
| 31 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
---|
| 32 |
|
---|
| 33 | b.Property<string>("ContactName")
|
---|
| 34 | .IsRequired()
|
---|
| 35 | .HasColumnType("text");
|
---|
| 36 |
|
---|
| 37 | b.Property<string>("ContactNumber")
|
---|
| 38 | .IsRequired()
|
---|
| 39 | .HasColumnType("text");
|
---|
| 40 |
|
---|
| 41 | b.Property<int>("ReservationPlace")
|
---|
| 42 | .HasColumnType("integer");
|
---|
| 43 |
|
---|
| 44 | b.Property<int>("ReservationStatus")
|
---|
| 45 | .HasColumnType("integer");
|
---|
| 46 |
|
---|
| 47 | b.Property<int>("ReservationType")
|
---|
| 48 | .HasColumnType("integer");
|
---|
| 49 |
|
---|
| 50 | b.Property<int>("RestaurantId")
|
---|
| 51 | .HasColumnType("integer");
|
---|
| 52 |
|
---|
| 53 | b.Property<DateTime>("StartDate")
|
---|
| 54 | .HasColumnType("timestamp with time zone");
|
---|
| 55 |
|
---|
| 56 | b.HasKey("Id");
|
---|
| 57 |
|
---|
| 58 | b.HasIndex("RestaurantId");
|
---|
| 59 |
|
---|
| 60 | b.ToTable("Reservations");
|
---|
| 61 | });
|
---|
| 62 |
|
---|
| 63 | modelBuilder.Entity("backend.Entities.Restaurant", b =>
|
---|
| 64 | {
|
---|
| 65 | b.Property<int>("Id")
|
---|
| 66 | .ValueGeneratedOnAdd()
|
---|
| 67 | .HasColumnType("integer");
|
---|
| 68 |
|
---|
| 69 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
---|
| 70 |
|
---|
| 71 | b.Property<string>("Name")
|
---|
| 72 | .IsRequired()
|
---|
| 73 | .HasColumnType("text");
|
---|
| 74 |
|
---|
| 75 | b.Property<int?>("OwnerFk")
|
---|
| 76 | .HasColumnType("integer");
|
---|
| 77 |
|
---|
| 78 | b.HasKey("Id");
|
---|
| 79 |
|
---|
| 80 | b.HasIndex("OwnerFk")
|
---|
| 81 | .IsUnique();
|
---|
| 82 |
|
---|
| 83 | b.ToTable("Restoraunts");
|
---|
| 84 | });
|
---|
| 85 |
|
---|
| 86 | modelBuilder.Entity("backend.Entities.User", b =>
|
---|
| 87 | {
|
---|
| 88 | b.Property<int>("Id")
|
---|
| 89 | .ValueGeneratedOnAdd()
|
---|
| 90 | .HasColumnType("integer");
|
---|
| 91 |
|
---|
| 92 | NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
---|
| 93 |
|
---|
| 94 | b.Property<string>("Password")
|
---|
| 95 | .IsRequired()
|
---|
| 96 | .HasColumnType("text");
|
---|
| 97 |
|
---|
| 98 | b.Property<string>("Username")
|
---|
| 99 | .IsRequired()
|
---|
| 100 | .HasColumnType("text");
|
---|
| 101 |
|
---|
| 102 | b.HasKey("Id");
|
---|
| 103 |
|
---|
| 104 | b.ToTable("Users");
|
---|
| 105 | });
|
---|
| 106 |
|
---|
| 107 | modelBuilder.Entity("backend.Entities.Reservation", b =>
|
---|
| 108 | {
|
---|
| 109 | b.HasOne("backend.Entities.Restaurant", "Restaurant")
|
---|
| 110 | .WithMany("Reservations")
|
---|
| 111 | .HasForeignKey("RestaurantId")
|
---|
| 112 | .OnDelete(DeleteBehavior.Cascade)
|
---|
| 113 | .IsRequired();
|
---|
| 114 |
|
---|
| 115 | b.Navigation("Restaurant");
|
---|
| 116 | });
|
---|
| 117 |
|
---|
| 118 | modelBuilder.Entity("backend.Entities.Restaurant", b =>
|
---|
| 119 | {
|
---|
| 120 | b.HasOne("backend.Entities.User", "Owner")
|
---|
| 121 | .WithOne("Restaurant")
|
---|
| 122 | .HasForeignKey("backend.Entities.Restaurant", "OwnerFk");
|
---|
| 123 |
|
---|
| 124 | b.Navigation("Owner");
|
---|
| 125 | });
|
---|
| 126 |
|
---|
| 127 | modelBuilder.Entity("backend.Entities.Restaurant", b =>
|
---|
| 128 | {
|
---|
| 129 | b.Navigation("Reservations");
|
---|
| 130 | });
|
---|
| 131 |
|
---|
| 132 | modelBuilder.Entity("backend.Entities.User", b =>
|
---|
| 133 | {
|
---|
| 134 | b.Navigation("Restaurant")
|
---|
| 135 | .IsRequired();
|
---|
| 136 | });
|
---|
| 137 | #pragma warning restore 612, 618
|
---|
| 138 | }
|
---|
| 139 | }
|
---|
| 140 | }
|
---|