2023-07-09 11:15:39 +02:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace Weiferl.Databas.EF.Migrations
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
2023-07-09 11:51:47 +02:00
|
|
|
|
public partial class init : Migration
|
2023-07-09 11:15:39 +02:00
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.AlterDatabase()
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Countries",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Slug = table.Column<string>(type: "longtext", nullable: false)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Name = table.Column<string>(type: "longtext", nullable: false)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Countries", x => x.Id);
|
|
|
|
|
})
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Users",
|
|
|
|
|
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)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Lastname = table.Column<string>(type: "longtext", nullable: false)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Email = table.Column<string>(type: "longtext", nullable: false)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Birthday = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
|
|
|
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
|
|
|
CountrySlug = table.Column<string>(type: "longtext", nullable: false)
|
2023-07-09 11:51:47 +02:00
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
RegisterDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
2023-07-09 11:15:39 +02:00
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Users", x => x.Id);
|
|
|
|
|
})
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Countries");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Users");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|