mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Data migration for developers
- NHibernate auto-update is explicitly run by the user (dev) through a DevTool Controller Action or Command - Generate the create method from the nhib schema --HG-- branch : dev
This commit is contained in:
@@ -64,12 +64,12 @@ namespace Orchard.Tests.Data.Builders {
|
||||
var parameters = new SessionFactoryParameters {
|
||||
Provider = "SQLite",
|
||||
DataFolder = _tempDataFolder,
|
||||
UpdateSchema = true,
|
||||
RecordDescriptors = recordDescriptors
|
||||
};
|
||||
var sessionFactory = manager
|
||||
.CreateProvider(parameters)
|
||||
.BuildSessionFactory(parameters);
|
||||
.BuildConfiguration(parameters)
|
||||
.BuildSessionFactory();
|
||||
|
||||
|
||||
var session = sessionFactory.OpenSession();
|
||||
@@ -102,12 +102,12 @@ namespace Orchard.Tests.Data.Builders {
|
||||
Provider = "SqlServer",
|
||||
DataFolder = _tempDataFolder,
|
||||
ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;",
|
||||
UpdateSchema = true,
|
||||
RecordDescriptors = recordDescriptors,
|
||||
};
|
||||
var sessionFactory = manager
|
||||
.CreateProvider(parameters)
|
||||
.BuildSessionFactory(parameters);
|
||||
.BuildConfiguration(parameters)
|
||||
.BuildSessionFactory();
|
||||
|
||||
|
||||
|
||||
|
@@ -59,7 +59,6 @@ namespace Orchard.Tests.DataMigration {
|
||||
builder.RegisterInstance(_folders).As<IExtensionFolders>();
|
||||
builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterType<DataMigrationManager>().As<IDataMigrationManager>();
|
||||
builder.RegisterType<DefaultDataMigrationGenerator>().As<IDataMigrationGenerator>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
|
Reference in New Issue
Block a user