This commit is contained in:
Dmitrii Kollerov
2026-09-25 08:05:46 +03:00
parent 2b05c26eb3
commit 68da43a673
29 changed files with 867 additions and 2 deletions
+56
View File
@@ -0,0 +1,56 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using example_app.Database.Connector;
#nullable disable
namespace example_csharp_app.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260925040202_init")]
partial class init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("example_csharp_app.Dto.BookDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Author")
.IsRequired()
.HasColumnType("text");
b.Property<string>("BookIndex")
.IsRequired()
.HasColumnType("xml");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("YearPublished")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Books", (string)null);
});
#pragma warning restore 612, 618
}
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace example_csharp_app.Migrations
{
/// <inheritdoc />
public partial class init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Books",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
Author = table.Column<string>(type: "text", nullable: false),
YearPublished = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
BookIndex = table.Column<string>(type: "xml", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Books", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Books");
}
}
}
+53
View File
@@ -0,0 +1,53 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using example_app.Database.Connector;
#nullable disable
namespace example_csharp_app.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("example_csharp_app.Dto.BookDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Author")
.IsRequired()
.HasColumnType("text");
b.Property<string>("BookIndex")
.IsRequired()
.HasColumnType("xml");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("YearPublished")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Books", (string)null);
});
#pragma warning restore 612, 618
}
}
}