From 05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 19:21:35 +0800 Subject: Split front and back end. --- .../Migrations/20200229103848_AddPostLocalId.cs | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 Timeline/Migrations/20200229103848_AddPostLocalId.cs (limited to 'Timeline/Migrations/20200229103848_AddPostLocalId.cs') diff --git a/Timeline/Migrations/20200229103848_AddPostLocalId.cs b/Timeline/Migrations/20200229103848_AddPostLocalId.cs deleted file mode 100644 index 497b38a1..00000000 --- a/Timeline/Migrations/20200229103848_AddPostLocalId.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Timeline.Migrations -{ - public partial class AddPostLocalId : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - migrationBuilder.AddColumn( - name: "current_post_local_id", - table: "timelines", - nullable: false, - defaultValue: 0L); - - migrationBuilder.AddColumn( - name: "local_id", - table: "timeline_posts", - nullable: false, - defaultValue: 0L); - - migrationBuilder.Sql(@" -UPDATE timeline_posts -SET local_id = (SELECT COUNT (*) - FROM timeline_posts AS p - WHERE p.timeline = timeline_posts.timeline - AND p.id <= timeline_posts.id); - -UPDATE timelines -SET current_post_local_id = (SELECT COUNT (*) - FROM timeline_posts AS p - WHERE p.timeline = timelines.id); - "); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} -- cgit v1.2.3