using System; using Microsoft.EntityFrameworkCore.Migrations; namespace DevHive.Data.Migrations { public partial class ProfilePicture : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "ProfilePictureUrl", table: "AspNetUsers"); migrationBuilder.CreateTable( name: "ProfilePicture", columns: table => new { Id = table.Column(type: "uuid", nullable: false), UserId = table.Column(type: "uuid", nullable: false), PictureURL = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProfilePicture", x => x.Id); table.ForeignKey( name: "FK_ProfilePicture_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ProfilePicture_UserId", table: "ProfilePicture", column: "UserId", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ProfilePicture"); migrationBuilder.AddColumn( name: "ProfilePictureUrl", table: "AspNetUsers", type: "text", nullable: true); } } }