mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 11:36:33 +00:00
add postgres
This commit is contained in:
@@ -10,11 +10,19 @@ public static class AzaionDbSchemaHolder
|
||||
static AzaionDbSchemaHolder()
|
||||
{
|
||||
MappingSchema = new MappingSchema();
|
||||
|
||||
MappingSchema.EntityDescriptorCreatedCallback = (_, entityDescriptor) =>
|
||||
{
|
||||
foreach (var entityDescriptorColumn in entityDescriptor.Columns)
|
||||
entityDescriptorColumn.ColumnName = entityDescriptorColumn.ColumnName.ToSnakeCase();
|
||||
};
|
||||
|
||||
var builder = new FluentMappingBuilder(MappingSchema);
|
||||
|
||||
builder.Entity<User>()
|
||||
.HasTableName("users")
|
||||
.HasIdentity(x => x.Id);
|
||||
.HasIdentity(x => x.Id)
|
||||
.Property(x => x.Role).HasConversion(v => v.ToString(), v => (RoleEnum)Enum.Parse(typeof(RoleEnum), v));
|
||||
|
||||
builder.Build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user