50 lines
2.1 KiB
C#
50 lines
2.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Weiferl.Databas.EF.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class added_user : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterDatabase()
|
|
.Annotation("MySql:CharSet", "utf8mb3");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "User",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
Firstname = table.Column<string>(type: "longtext", nullable: false, collation: "utf8mb3_general_ci")
|
|
.Annotation("MySql:CharSet", "utf8mb3"),
|
|
Lastname = table.Column<string>(type: "longtext", nullable: false, collation: "utf8mb3_general_ci")
|
|
.Annotation("MySql:CharSet", "utf8mb3"),
|
|
Email = table.Column<string>(type: "longtext", nullable: false, collation: "utf8mb3_general_ci")
|
|
.Annotation("MySql:CharSet", "utf8mb3"),
|
|
Birthday = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_User", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb3")
|
|
.Annotation("Relational:Collation", "utf8mb3_general_ci");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "User");
|
|
}
|
|
}
|
|
}
|