using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace UniversityDataBaseImplemet.Migrations { /// public partial class fixCustomerStream : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EducationGroupViewModel", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false), NumberOfStudent = table.Column(type: "integer", nullable: false), UserId = table.Column(type: "integer", nullable: false), StreamId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_EducationGroupViewModel", x => x.Id); table.ForeignKey( name: "FK_EducationGroupViewModel_Streams_StreamId", column: x => x.StreamId, principalTable: "Streams", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_EducationGroupViewModel_StreamId", table: "EducationGroupViewModel", column: "StreamId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EducationGroupViewModel"); } } }