1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace WpfAppUI.Migrations
- {
- /// <inheritdoc />
- public partial class initial : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Posts",
- columns: table => new
- {
- id = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Posts", x => x.id);
- });
- migrationBuilder.CreateTable(
- name: "Emploees",
- columns: table => new
- {
- id = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Surname = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Patronymic = table.Column<string>(type: "nvarchar(max)", nullable: true),
- PostId = table.Column<int>(type: "int", nullable: false),
- Birthday = table.Column<DateTime>(type: "date", nullable: false),
- Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Mail = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Emploees", x => x.id);
- table.ForeignKey(
- name: "FK_Emploees_Posts_PostId",
- column: x => x.PostId,
- principalTable: "Posts",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateIndex(
- name: "IX_Emploees_PostId",
- table: "Emploees",
- column: "PostId");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Emploees");
- migrationBuilder.DropTable(
- name: "Posts");
- }
- }
- }
|