diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-03 10:22:37 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-03 10:22:37 +0200 |
| commit | 01ad75fa5a871a0c9f8cd0c5291312286ae4d52d (patch) | |
| tree | 4f6b2eaef0424ffbfdd405939fbaa9325cc9d2c8 /src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs | |
| parent | 81b3fc43a900857443c3c763f52e0a54719c2fae (diff) | |
| download | DevHive-01ad75fa5a871a0c9f8cd0c5291312286ae4d52d.tar DevHive-01ad75fa5a871a0c9f8cd0c5291312286ae4d52d.tar.gz DevHive-01ad75fa5a871a0c9f8cd0c5291312286ae4d52d.zip | |
Implemented profile picture table functionality; added models and interfaces for profile picture; added ability for user layers to update the profile picture; added migrations; updated mappings
Diffstat (limited to 'src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs')
| -rw-r--r-- | src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs b/src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs new file mode 100644 index 0000000..1b0c2c6 --- /dev/null +++ b/src/DevHive.Data/Migrations/20210203071720_ProfilePicture.cs @@ -0,0 +1,52 @@ +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<Guid>(type: "uuid", nullable: false), + UserId = table.Column<Guid>(type: "uuid", nullable: false), + PictureURL = table.Column<string>(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<string>( + name: "ProfilePictureUrl", + table: "AspNetUsers", + type: "text", + nullable: true); + } + } +} |
