Merge branch 'dev' into cms-kit/content-admin

pull/6926/head
Ilkay Ilknur 5 years ago
commit 131709d080

@ -151,6 +151,54 @@ namespace Volo.CmsKit.EntityFrameworkCore
b.HasIndex(x => new { x.TenantId, x.Url });
});
b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId});
});
}
if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{
builder.Entity<Tag>(b =>
{
b.ToTable(options.TablePrefix + "Tags", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength);
b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength);
b.HasIndex(x => new {x.TenantId, x.Name});
});
builder.Entity<EntityTag>(b =>
{
b.ToTable(options.TablePrefix + "EntityTags", options.Schema);
b.ConfigureByConvention();
b.HasKey(x => new {x.EntityId, x.TagId});
b.Property(x => x.EntityId).IsRequired();
b.Property(x => x.TagId).IsRequired();
b.HasIndex(x => new {x.TenantId, x.EntityId, x.TagId});
});
}
if (GlobalFeatureManager.Instance.IsEnabled<PagesFeature>())
{
builder.Entity<Page>(b =>
{
b.ToTable(options.TablePrefix + "Pages", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength);
b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength);
b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength);
b.HasIndex(x => new {x.TenantId, x.Url});
});
}
}
}
}

Loading…
Cancel
Save