47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||
|
|
|
||
|
|
#nullable disable
|
||
|
|
|
||
|
|
namespace mws.backend.dotnet.infrastructure.Migrations
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
public partial class AddMasterData : Migration
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||
|
|
{
|
||
|
|
migrationBuilder.CreateTable(
|
||
|
|
name: "master_data",
|
||
|
|
columns: table => new
|
||
|
|
{
|
||
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||
|
|
Group = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||
|
|
Label = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||
|
|
Value = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||
|
|
SortOrder = table.Column<int>(type: "integer", nullable: false),
|
||
|
|
IsActive = table.Column<bool>(type: "boolean", nullable: false),
|
||
|
|
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||
|
|
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||
|
|
},
|
||
|
|
constraints: table =>
|
||
|
|
{
|
||
|
|
table.PrimaryKey("PK_master_data", x => x.Id);
|
||
|
|
});
|
||
|
|
|
||
|
|
migrationBuilder.CreateIndex(
|
||
|
|
name: "IX_master_data_Group_Value",
|
||
|
|
table: "master_data",
|
||
|
|
columns: new[] { "Group", "Value" },
|
||
|
|
unique: true);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <inheritdoc />
|
||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||
|
|
{
|
||
|
|
migrationBuilder.DropTable(
|
||
|
|
name: "master_data");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|