diff --git a/SeaPublicWebsite.Data/Migrations/20240806095041_ForwardFillTimestamps.cs b/SeaPublicWebsite.Data/Migrations/20240806095041_ForwardFillTimestamps.cs index 63b96358..82712bd1 100644 --- a/SeaPublicWebsite.Data/Migrations/20240806095041_ForwardFillTimestamps.cs +++ b/SeaPublicWebsite.Data/Migrations/20240806095041_ForwardFillTimestamps.cs @@ -13,12 +13,12 @@ protected override void Up(MigrationBuilder migrationBuilder) { Sql = @" with grouped_table as ( - SELECT *, count(""RecommendationsFirstRetrievedAt"") + SELECT ""PropertyDataId"", ""RecommendationsFirstRetrievedAt"", count(""RecommendationsFirstRetrievedAt"") OVER (ORDER BY ""PropertyDataId"") AS _grp FROM ""PropertyData"" ), final_table AS( - SELECT *, _grp, FIRST_VALUE(""RecommendationsFirstRetrievedAt"") + SELECT ""PropertyDataId"", _grp, FIRST_VALUE(""RecommendationsFirstRetrievedAt"") OVER (partition by _grp order by ""PropertyDataId"") AS smeared_timestamps FROM grouped_table ) UPDATE ""PropertyData"" p