source: resTools_backend/backend/Migrations/20220411130410_Add-Persons.Designer.cs

Last change on this file was 7a983b0, checked in by Danilo <danilo.najkov@…>, 3 years ago

move files

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