using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FoodsharingSiegen.Server.Migrations { public partial class init : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Prospects", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Created = table.Column(type: "TEXT", nullable: false), FsId = table.Column(type: "INTEGER", nullable: false), Memo = table.Column(type: "TEXT", nullable: true), Name = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Prospects", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Created = table.Column(type: "TEXT", nullable: false), EncryptedPassword = table.Column(type: "TEXT", nullable: false), ForceLogout = table.Column(type: "INTEGER", nullable: false), Groups = table.Column(type: "TEXT", nullable: false), Mail = table.Column(type: "TEXT", nullable: false), Memo = table.Column(type: "TEXT", nullable: true), Name = table.Column(type: "TEXT", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), Verified = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.CreateTable( name: "Interactions", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Alert = table.Column(type: "INTEGER", nullable: false), Created = table.Column(type: "TEXT", nullable: false), Date = table.Column(type: "TEXT", nullable: false), Info = table.Column(type: "TEXT", nullable: true), NotNeeded = table.Column(type: "INTEGER", nullable: false), ProspectID = table.Column(type: "TEXT", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), UserID = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Interactions", x => x.Id); table.ForeignKey( name: "FK_Interactions_Prospects_ProspectID", column: x => x.ProspectID, principalTable: "Prospects", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Interactions_Users_UserID", column: x => x.UserID, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Interactions_ProspectID", table: "Interactions", column: "ProspectID"); migrationBuilder.CreateIndex( name: "IX_Interactions_UserID", table: "Interactions", column: "UserID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Interactions"); migrationBuilder.DropTable( name: "Prospects"); migrationBuilder.DropTable( name: "Users"); } } }