mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Exposing table prefix information in SchemaBuilder.
Making DataMigrationImpl methods virtual for easier customization. --HG-- branch : 1.x
This commit is contained in:
@@ -7,8 +7,8 @@ namespace Orchard.Data.Migration {
|
||||
/// Data Migration classes can inherit from this class to get a SchemaBuilder instance configured with the current tenant database prefix
|
||||
/// </summary>
|
||||
public abstract class DataMigrationImpl : IDataMigration {
|
||||
public SchemaBuilder SchemaBuilder { get; set; }
|
||||
public IContentDefinitionManager ContentDefinitionManager {get; set; }
|
||||
public virtual SchemaBuilder SchemaBuilder { get; set; }
|
||||
public virtual IContentDefinitionManager ContentDefinitionManager { get; set; }
|
||||
public virtual Feature Feature { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,18 @@ namespace Orchard.Data.Migration.Schema {
|
||||
_formatPrefix = formatPrefix ?? (s => s ?? String.Empty);
|
||||
}
|
||||
|
||||
public IDataMigrationInterpreter Interpreter {
|
||||
get { return _interpreter; }
|
||||
}
|
||||
|
||||
public string FeaturePrefix {
|
||||
get { return _featurePrefix; }
|
||||
}
|
||||
|
||||
public Func<string, string> FormatPrefix {
|
||||
get { return _formatPrefix; }
|
||||
}
|
||||
|
||||
public SchemaBuilder CreateTable(string name, Action<CreateTableCommand> table) {
|
||||
var createTable = new CreateTableCommand(String.Concat(_formatPrefix(_featurePrefix), name));
|
||||
table(createTable);
|
||||
|
||||
Reference in New Issue
Block a user