49 lines
1.9 KiB
C#
49 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace UniversityDataBaseImplemet.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class fixCustomerStream : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "EducationGroupViewModel",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
Name = table.Column<string>(type: "text", nullable: false),
|
|
NumberOfStudent = table.Column<int>(type: "integer", nullable: false),
|
|
UserId = table.Column<int>(type: "integer", nullable: false),
|
|
StreamId = table.Column<int>(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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "EducationGroupViewModel");
|
|
}
|
|
}
|
|
}
|