summaryrefslogtreecommitdiff
path: root/HBContext.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-06-22 00:15:14 +1000
committerJake Mannens <jake@asger.xyz>2026-06-25 02:23:14 +1000
commit440071053030579c35216b29aa3f0fe8fc7887b5 (patch)
treed331019cbaa11921928f4d1d24765a0a205be54a /HBContext.cs
parent16aa1d68777f4d5a6f41df6612f2a4535394d334 (diff)
Moved internal tag GUIDs to the ApiModels assembly
Diffstat (limited to 'HBContext.cs')
-rw-r--r--HBContext.cs15
1 files changed, 3 insertions, 12 deletions
diff --git a/HBContext.cs b/HBContext.cs
index 766c0a3..d13378d 100644
--- a/HBContext.cs
+++ b/HBContext.cs
@@ -4,16 +4,7 @@ using Microsoft.EntityFrameworkCore;
namespace HyperBooru;
-enum HBObjectId {
- NsfwTag = -1,
- IngestTag = -2,
- AdminUser = -3
-}
-
public class HBContext : DbContext {
- public static readonly Guid NsfwTag = new("EBDAD4F8-455A-4351-8017-1D4854D6FA38");
- public static readonly Guid IngestTag = new("EA212801-5BCC-4C0E-814F-FB9D30DB58BC");
- public static readonly Guid AdminUser = new("4FA948F4-7C45-4F81-BB6B-E417491E6C96");
public DbSet<HBObject> Objects { get; set; }
public DbSet<User> Users { get; set; }
@@ -49,13 +40,13 @@ public class HBContext : DbContext {
modelBuilder.Entity<TagDefinition>().HasData(new TagDefinition[] {
new() {
ObjectId = (int) HBObjectId.NsfwTag,
- Guid = NsfwTag,
+ Guid = InternalTag.NsfwTag,
Source = TagSource.Internal,
Name = "nsfw"
},
new() {
ObjectId = (int) HBObjectId.IngestTag,
- Guid = IngestTag,
+ Guid = InternalTag.IngestTag,
Source = TagSource.Internal,
Name = "ingest"
}
@@ -65,7 +56,7 @@ public class HBContext : DbContext {
modelBuilder.Entity<User>().HasData(new User[] {
new() {
ObjectId = (int) HBObjectId.AdminUser,
- Guid = AdminUser,
+ Guid = InternalTag.AdminUser,
Username = "admin",
PasswordHash = UserService.HashPassword("admin")
}