mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 08:36:32 +00:00
db works, upload works
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Azaion.Common.Entities;
|
||||
using LinqToDB;
|
||||
using LinqToDB.Mapping;
|
||||
|
||||
namespace Azaion.Common.Database;
|
||||
@@ -21,8 +22,12 @@ public static class AzaionDbSchemaHolder
|
||||
|
||||
builder.Entity<User>()
|
||||
.HasTableName("users")
|
||||
.HasIdentity(x => x.Id)
|
||||
.Property(x => x.Role).HasConversion(v => v.ToString(), v => (RoleEnum)Enum.Parse(typeof(RoleEnum), v));
|
||||
.Property(x => x.Id)
|
||||
.IsPrimaryKey()
|
||||
.HasDataType(DataType.Guid)
|
||||
.Property(x => x.Role)
|
||||
.HasDataType(DataType.Text)
|
||||
.HasConversion(v => v.ToString(), v => (RoleEnum)Enum.Parse(typeof(RoleEnum), v));
|
||||
|
||||
builder.Build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user