211 lines
7.0 KiB
C#
211 lines
7.0 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using BulletinBoardDatabase;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace BulletinBoardDatabase.Migrations
|
|
{
|
|
[DbContext(typeof(BulletinBoardDatabase))]
|
|
[Migration("20240405213513_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.3")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.Announcement", b =>
|
|
{
|
|
b.Property<int?>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int?>("Id"));
|
|
|
|
b.Property<int?>("CategoryId")
|
|
.IsRequired()
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("RegionId")
|
|
.IsRequired()
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("ReviewRating")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("ReviewText")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("StartDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("RegionId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Announcements");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.Category", b =>
|
|
{
|
|
b.Property<int?>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int?>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.City", b =>
|
|
{
|
|
b.Property<int?>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int?>("Id"));
|
|
|
|
b.Property<int>("CityId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("CityName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("RegionId")
|
|
.IsRequired()
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CityId");
|
|
|
|
b.ToTable("Cities");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.Region", b =>
|
|
{
|
|
b.Property<int?>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int?>("Id"));
|
|
|
|
b.Property<string>("RegionName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Regions");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.User", b =>
|
|
{
|
|
b.Property<int?>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int?>("Id"));
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Surname")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.Announcement", b =>
|
|
{
|
|
b.HasOne("BulletinBoardDatabase.Models.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("BulletinBoardDatabase.Models.Region", "Region")
|
|
.WithMany()
|
|
.HasForeignKey("RegionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("BulletinBoardDatabase.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Region");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.City", b =>
|
|
{
|
|
b.HasOne("BulletinBoardDatabase.Models.Region", "Region")
|
|
.WithMany("Cities")
|
|
.HasForeignKey("CityId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Region");
|
|
});
|
|
|
|
modelBuilder.Entity("BulletinBoardDatabase.Models.Region", b =>
|
|
{
|
|
b.Navigation("Cities");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|