-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#102) FileCache: improve the workarounds for the older versions of W…
…indows
- Loading branch information
Showing
3 changed files
with
104 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
Emulsion.Database/Migrations/20220828132228_UpdatedUniqueContentIndex.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// <auto-generated /> | ||
namespace Emulsion.Database.Migrations | ||
|
||
open System | ||
open Emulsion.Database | ||
open Microsoft.EntityFrameworkCore | ||
open Microsoft.EntityFrameworkCore.Infrastructure | ||
open Microsoft.EntityFrameworkCore.Migrations | ||
|
||
[<DbContext(typeof<EmulsionDbContext>)>] | ||
[<Migration("20220828132228_UpdatedUniqueContentIndex")>] | ||
type UpdatedUniqueContentIndex() = | ||
inherit Migration() | ||
|
||
override this.Up(migrationBuilder:MigrationBuilder) = | ||
migrationBuilder.Sql @" | ||
drop index TelegramContents_Unique | ||
create unique index TelegramContents_Unique | ||
on TelegramContents(ChatUserName, MessageId, FileId, FileName, MimeType) | ||
" |> ignore | ||
|
||
override this.Down(migrationBuilder:MigrationBuilder) = | ||
migrationBuilder.Sql @" | ||
drop index TelegramContents_Unique | ||
create unique index TelegramContents_Unique | ||
on TelegramContents(ChatUserName, MessageId, FileId) | ||
" |> ignore | ||
|
||
override this.BuildTargetModel(modelBuilder: ModelBuilder) = | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "5.0.10") | ||
|> ignore | ||
|
||
modelBuilder.Entity("Emulsion.Database.Entities.TelegramContent", (fun b -> | ||
|
||
b.Property<Int64>("Id") | ||
.IsRequired(true) | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("INTEGER") |> ignore | ||
b.Property<string>("ChatUserName") | ||
.IsRequired(false) | ||
.HasColumnType("TEXT") |> ignore | ||
b.Property<string>("FileId") | ||
.IsRequired(false) | ||
.HasColumnType("TEXT") |> ignore | ||
b.Property<string option>("FileName") | ||
.IsRequired(false) | ||
.HasColumnType("TEXT") |> ignore | ||
b.Property<Int64>("MessageId") | ||
.IsRequired(true) | ||
.HasColumnType("INTEGER") |> ignore | ||
b.Property<string option>("MimeType") | ||
.IsRequired(false) | ||
.HasColumnType("TEXT") |> ignore | ||
|
||
b.HasKey("Id") |> ignore | ||
|
||
b.ToTable("TelegramContents") |> ignore | ||
|
||
)) |> ignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters