86 lines
4.3 KiB
C#
86 lines
4.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace gehGassi.Persistence.Migrations
|
|
{
|
|
public partial class DogWalkerPofilesAndCertificatesAdded : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Certificates",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
AppUserId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
|
FileName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
|
Status = table.Column<int>(type: "int", nullable: false),
|
|
VerificationDate = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
|
VerifiedBy = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
|
VerificationComment = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
|
InternalComment = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
|
Created = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Certificates", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Certificates_AppUsers_AppUserId",
|
|
column: x => x.AppUserId,
|
|
principalTable: "AppUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "DogWalkerProfiles",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
Radius = table.Column<double>(type: "float", nullable: false),
|
|
About = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
|
|
AllowedRequests = table.Column<int>(type: "int", nullable: false),
|
|
PuppyAllowed = table.Column<bool>(type: "bit", nullable: false),
|
|
DifficultAllowed = table.Column<bool>(type: "bit", nullable: false),
|
|
AggressionLevel = table.Column<int>(type: "int", nullable: false),
|
|
AcceptedSize = table.Column<int>(type: "int", nullable: false),
|
|
PriceWalk = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|
PriceDay = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|
PriceSitting = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|
Index = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Version = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
|
|
UpdatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
Deleted = table.Column<bool>(type: "bit", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DogWalkerProfiles", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Certificates_AppUserId",
|
|
table: "Certificates",
|
|
column: "AppUserId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DogWalkerProfiles_Index",
|
|
table: "DogWalkerProfiles",
|
|
column: "Index");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Certificates");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "DogWalkerProfiles");
|
|
}
|
|
}
|
|
}
|