44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using MySql.EntityFrameworkCore.Metadata;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace EmployeeManagementApp.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class InitialCreate : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AlterDatabase()
|
|||
|
.Annotation("MySQL:Charset", "utf8mb4");
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Employees",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
|
|||
|
FirstName = table.Column<string>(type: "longtext", nullable: false),
|
|||
|
LastName = table.Column<string>(type: "longtext", nullable: false),
|
|||
|
Position = table.Column<string>(type: "longtext", nullable: false),
|
|||
|
Salary = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|||
|
VacationDays = table.Column<int>(type: "int", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Employees", x => x.Id);
|
|||
|
})
|
|||
|
.Annotation("MySQL:Charset", "utf8mb4");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Employees");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|