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(type: "TEXT", nullable: false), Created = table.Column(type: "TEXT", nullable: true), Data1 = table.Column(type: "TEXT", nullable: true), Data2 = table.Column(type: "TEXT", nullable: true), Type = table.Column(type: "INTEGER", nullable: false), UserID = table.Column(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"); } } }