46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace FoodsharingSiegen.Server.Migrations
|
|
{
|
|
public partial class Audit : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Audits",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
Created = table.Column<DateTime>(type: "TEXT", nullable: true),
|
|
Data1 = table.Column<string>(type: "TEXT", nullable: true),
|
|
Data2 = table.Column<string>(type: "TEXT", nullable: true),
|
|
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
|
UserID = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Audits", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Audits_Users_UserID",
|
|
column: x => x.UserID,
|
|
principalTable: "Users",
|
|
principalColumn: "Id");
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Audits_UserID",
|
|
table: "Audits",
|
|
column: "UserID");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Audits");
|
|
}
|
|
}
|
|
}
|