forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MagicCarpetDatabase.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class ChangeEmployeeAndPost : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Salary",
|
|
table: "Posts");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Configuration",
|
|
table: "Posts",
|
|
type: "jsonb",
|
|
nullable: false,
|
|
defaultValue: "{\"Rate\": 0, \"Type\": \"PostConfiguration\"}");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "DateOfDelete",
|
|
table: "Employees",
|
|
type: "timestamp with time zone",
|
|
nullable: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Configuration",
|
|
table: "Posts");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "DateOfDelete",
|
|
table: "Employees");
|
|
|
|
migrationBuilder.AddColumn<double>(
|
|
name: "Salary",
|
|
table: "Posts",
|
|
type: "double precision",
|
|
nullable: false,
|
|
defaultValue: 0.0);
|
|
}
|
|
}
|
|
}
|