53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PyroFetes.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class FixingDatabase : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "References",
|
|
table: "Products");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SellingPrice",
|
|
table: "Products");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Reference",
|
|
table: "Products",
|
|
type: "nvarchar(20)",
|
|
maxLength: 20,
|
|
nullable: false,
|
|
defaultValue: "");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Reference",
|
|
table: "Products");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "References",
|
|
table: "Products",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "SellingPrice",
|
|
table: "Products",
|
|
type: "decimal(18,2)",
|
|
nullable: false,
|
|
defaultValue: 0m);
|
|
}
|
|
}
|
|
}
|