From 1d6326e7bf14967c670247bea042c92a0a7ee94e Mon Sep 17 00:00:00 2001 From: transtrike Date: Sun, 31 Jan 2021 13:45:15 +0200 Subject: Redone migrations --- .../20210130092813_CloudinaryFileUpload.cs | 145 --------------------- 1 file changed, 145 deletions(-) delete mode 100644 src/DevHive.Data/Migrations/20210130092813_CloudinaryFileUpload.cs (limited to 'src/DevHive.Data/Migrations/20210130092813_CloudinaryFileUpload.cs') diff --git a/src/DevHive.Data/Migrations/20210130092813_CloudinaryFileUpload.cs b/src/DevHive.Data/Migrations/20210130092813_CloudinaryFileUpload.cs deleted file mode 100644 index f691c9b..0000000 --- a/src/DevHive.Data/Migrations/20210130092813_CloudinaryFileUpload.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace DevHive.Data.Migrations -{ - public partial class CloudinaryFileUpload : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Comments_Posts_PostId", - table: "Comments"); - - migrationBuilder.AlterColumn( - name: "CreatorId", - table: "Posts", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AddColumn>( - name: "FileUrls", - table: "Posts", - type: "text[]", - nullable: true); - - migrationBuilder.AlterColumn( - name: "PostId", - table: "Comments", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "CreatorId", - table: "Comments", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.CreateIndex( - name: "IX_Posts_CreatorId", - table: "Posts", - column: "CreatorId"); - - migrationBuilder.CreateIndex( - name: "IX_Comments_CreatorId", - table: "Comments", - column: "CreatorId"); - - migrationBuilder.AddForeignKey( - name: "FK_Comments_AspNetUsers_CreatorId", - table: "Comments", - column: "CreatorId", - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Comments_Posts_PostId", - table: "Comments", - column: "PostId", - principalTable: "Posts", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Posts_AspNetUsers_CreatorId", - table: "Posts", - column: "CreatorId", - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Comments_AspNetUsers_CreatorId", - table: "Comments"); - - migrationBuilder.DropForeignKey( - name: "FK_Comments_Posts_PostId", - table: "Comments"); - - migrationBuilder.DropForeignKey( - name: "FK_Posts_AspNetUsers_CreatorId", - table: "Posts"); - - migrationBuilder.DropIndex( - name: "IX_Posts_CreatorId", - table: "Posts"); - - migrationBuilder.DropIndex( - name: "IX_Comments_CreatorId", - table: "Comments"); - - migrationBuilder.DropColumn( - name: "FileUrls", - table: "Posts"); - - migrationBuilder.AlterColumn( - name: "CreatorId", - table: "Posts", - type: "uuid", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "PostId", - table: "Comments", - type: "uuid", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreatorId", - table: "Comments", - type: "uuid", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_Comments_Posts_PostId", - table: "Comments", - column: "PostId", - principalTable: "Posts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} -- cgit v1.2.3