64 lines
2.8 KiB
C#
64 lines
2.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace gehGassi.Persistence.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class ComplaintsAdded : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "WalkComplaints",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
WalkId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
Source = table.Column<int>(type: "int", nullable: false),
|
|
Type = table.Column<int>(type: "int", nullable: false),
|
|
Message = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
|
Status = table.Column<int>(type: "int", nullable: false),
|
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
Comment = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Resolved = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
|
Created = table.Column<DateTimeOffset>(type: "datetimeoffset", 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_WalkComplaints", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_WalkComplaints_Walks_WalkId",
|
|
column: x => x.WalkId,
|
|
principalTable: "Walks",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_WalkComplaints_Index",
|
|
table: "WalkComplaints",
|
|
column: "Index");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_WalkComplaints_WalkId",
|
|
table: "WalkComplaints",
|
|
column: "WalkId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "WalkComplaints");
|
|
}
|
|
}
|
|
}
|