using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace yaflay.ru.Migrations { /// public partial class Migrate271122342 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "public"); migrationBuilder.CreateTable( name: "Blogs", schema: "public", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Title = table.Column(type: "text", nullable: false), Text = table.Column(type: "text", nullable: false), Annotation = table.Column(type: "text", nullable: false), ImageUrl = table.Column(type: "text", nullable: true), dateTime = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Blogs", x => x.Id); }); migrationBuilder.CreateTable( name: "Comments", schema: "public", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), dateTime = table.Column(type: "bigint", nullable: false), Text = table.Column(type: "text", nullable: false), creatorMail = table.Column(type: "text", nullable: false), postId = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Comments", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Blogs", schema: "public"); migrationBuilder.DropTable( name: "Comments", schema: "public"); } } }