diff options
| author | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-12-29 09:41:56 +0100 |
|---|---|---|
| committer | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-12-29 09:41:56 +0100 |
| commit | 79f5eaf40b93d64be74d8b4f1ef80d19fadbfbe1 (patch) | |
| tree | ddf121e78bdd50673379b223abfdb448c4f81291 /CoreWiki/Migrations/20231225202905_ViewCount.cs | |
| parent | 1a96616699ab41bf6343bc1acc45a836c3e6caf3 (diff) | |
Diffstat (limited to 'CoreWiki/Migrations/20231225202905_ViewCount.cs')
| -rw-r--r-- | CoreWiki/Migrations/20231225202905_ViewCount.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/CoreWiki/Migrations/20231225202905_ViewCount.cs b/CoreWiki/Migrations/20231225202905_ViewCount.cs new file mode 100644 index 0000000..6d2f639 --- /dev/null +++ b/CoreWiki/Migrations/20231225202905_ViewCount.cs @@ -0,0 +1,44 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CoreWiki.Migrations +{ + /// <inheritdoc /> + public partial class ViewCount : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<int>( + name: "ViewCount", + table: "Articles", + type: "INTEGER", + nullable: false, + defaultValue: 0); + + migrationBuilder.UpdateData( + table: "Articles", + keyColumn: "Id", + keyValue: 1, + columns: new[] { "Published", "ViewCount" }, + values: new object[] { new DateTime(2023, 12, 25, 20, 29, 5, 642, DateTimeKind.Utc).AddTicks(7240), 0 }); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ViewCount", + table: "Articles"); + + migrationBuilder.UpdateData( + table: "Articles", + keyColumn: "Id", + keyValue: 1, + column: "Published", + value: new DateTime(2023, 12, 24, 18, 37, 32, 413, DateTimeKind.Utc).AddTicks(8400)); + } + } +} |
