From 65ae6c3400b9204771134f208e27f20926f23f8f Mon Sep 17 00:00:00 2001 From: Piotr Szmyd Date: Tue, 7 May 2013 23:31:46 +0200 Subject: [PATCH] Exposing table prefix information in SchemaBuilder. Making DataMigrationImpl methods virtual for easier customization. --HG-- branch : 1.x --- src/Orchard/Data/Migration/DataMigration.cs | 4 ++-- src/Orchard/Data/Migration/Schema/SchemaBuilder.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Orchard/Data/Migration/DataMigration.cs b/src/Orchard/Data/Migration/DataMigration.cs index 66b757916..d57c19b04 100644 --- a/src/Orchard/Data/Migration/DataMigration.cs +++ b/src/Orchard/Data/Migration/DataMigration.cs @@ -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 /// 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; } } } \ No newline at end of file diff --git a/src/Orchard/Data/Migration/Schema/SchemaBuilder.cs b/src/Orchard/Data/Migration/Schema/SchemaBuilder.cs index af73145b8..ccc0b1732 100644 --- a/src/Orchard/Data/Migration/Schema/SchemaBuilder.cs +++ b/src/Orchard/Data/Migration/Schema/SchemaBuilder.cs @@ -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 FormatPrefix { + get { return _formatPrefix; } + } + public SchemaBuilder CreateTable(string name, Action table) { var createTable = new CreateTableCommand(String.Concat(_formatPrefix(_featurePrefix), name)); table(createTable);