From a01358abf4378bfa469d18c6c07cbc0f2b16296a Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Mon, 1 Apr 2024 11:16:28 +0800 Subject: [PATCH] Update Migration1000.cs --- MyApp/Migrations/Migration1000.cs | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/MyApp/Migrations/Migration1000.cs b/MyApp/Migrations/Migration1000.cs index 08e6306..2156f4d 100644 --- a/MyApp/Migrations/Migration1000.cs +++ b/MyApp/Migrations/Migration1000.cs @@ -28,30 +28,6 @@ public class Vote public int Score { get; set; } } - public class StatTotals - { - // PostId (Question) or PostId-UserName (Answer) - public required string Id { get; set; } - - [Index] public int PostId { get; set; } - - [Index] public string? CreatedBy { get; set; } - - public int FavoriteCount { get; set; } - - // post.ViewCount + Sum(PostView.PostId) - public int ViewCount { get; set; } - - // Sum(Vote(PostId).Score > 0) - public int UpVotes { get; set; } - - // Sum(Vote(PostId).Score < 0) - public int DownVotes { get; set; } - - // post.Score || Meta.ModelVotes[PostId] (Model Ranking Score) - public int StartingUpVotes { get; set; } - } - public class Job { [AutoIncrement] @@ -154,22 +130,16 @@ public override void Up() Db.CreateTable(); Db.CreateTable(); Db.CreateTable(); - // Db.CreateTable(); Db.CreateTable(); Db.ExecuteSql("INSERT INTO UserInfo (UserId, UserName) SELECT Id, UserName FROM AspNetUsers"); - Db.ExecuteSql("ALTER TABLE StatTotals ADD COLUMN CreatedBy TEXT NULL"); - Db.ExecuteSql("CREATE INDEX idx_createdby ON StatTotals (CreatedBy)"); } public override void Down() { Db.DeleteAll(); - Db.ExecuteSql("ALTER TABLE StatTotals DROP COLUMN CreatedBy"); - Db.ExecuteSql("DROP INDEX IF EXISTS StatTotals.idx_createdby"); Db.DropTable(); - // Db.DropTable(); Db.DropTable(); Db.DropTable(); Db.DropTable();