Weiferl.Database.EF/Weiferl.Databas.EF/Migrations/20230723183039_init.cs

61 lines
2.3 KiB
C#
Raw Normal View History

2023-07-25 20:20:29 +02:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Weiferl.Databas.EF.Migrations
{
/// <inheritdoc />
public partial class init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Countries",
columns: table => new
{
2023-07-25 20:23:04 +02:00
2023-07-25 20:20:29 +02:00
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Slug = table.Column<string>(type: "nvarchar(max)", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Countries", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Firstname = table.Column<string>(type: "nvarchar(max)", nullable: false),
Lastname = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
Birthday = table.Column<DateTime>(type: "datetime2", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
CountrySlug = table.Column<string>(type: "nvarchar(max)", nullable: false),
RegisterDate = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Countries");
migrationBuilder.DropTable(
name: "Users");
}
}
}