diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2023-01-16 19:40:25 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2023-01-16 19:41:03 +0100 |
| commit | b36740899a577ac387f52229c2e714a9f09f2b84 (patch) | |
| tree | 68f17b027829111ab369a3c545f96cacfb479143 /src/Eva.cs | |
| parent | 7620b379d4284354715f82c226ca77c94b25a980 (diff) | |
| download | blob-bin-b36740899a577ac387f52229c2e714a9f09f2b84.tar.xz blob-bin-b36740899a577ac387f52229c2e714a9f09f2b84.zip | |
refactor: Rename Eva to Db
Diffstat (limited to 'src/Eva.cs')
| -rw-r--r-- | src/Eva.cs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/Eva.cs b/src/Eva.cs deleted file mode 100644 index 760231e..0000000 --- a/src/Eva.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace BlobBin; - -public sealed class Eva : DbContext -{ - private readonly bool migrated; - - public Eva(DbContextOptions<Eva> options) : base(options) { - if (!migrated) { - Database.Migrate(); - migrated = true; - } - } - - public DbSet<File> Files { get; set; } - public DbSet<Paste> Pastes { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - optionsBuilder.UseSqlite("data source = AppData/main.db"); - base.OnConfiguring(optionsBuilder); - } -} - -public class UploadEntityBase -{ - public UploadEntityBase() { - Id = Guid.NewGuid(); - CreatedAt = DateTime.UtcNow; - } - - public Guid Id { get; set; } - public string PublicId { get; set; } - public DateTime CreatedAt { get; set; } - public string CreatedBy { get; set; } - public DateTime? DeletedAt { get; set; } - public string? PasswordHash { get; set; } - public bool Singleton { get; set; } - public string? AutoDeleteAfter { get; set; } - public string? MimeType { get; set; } - public string DeletionKey { get; set; } - public string? Name { get; set; } - public long Length { get; set; } -} - -public class Paste : UploadEntityBase -{ - public string? Content { get; set; } -} - -public class File : UploadEntityBase -{ }
\ No newline at end of file |
