You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var persistenceConfig = MySQLConfiguration.Standard
.ConnectionString(connection.DatabaseConnectionString).Driver<NHibernate.Driver.MySqlConnector.MySqlConnectorDriver>().Dialect<NHibernate.Dialect.MySQL57Dialect>();
StringBuilder sqlscript = new StringBuilder();
var factory = Fluently.Configure()
.Database(persistenceConfig)
.Mappings(m => {
foreach (var assembly in assemblies)
{
m.FluentMappings.AddFromAssembly(assembly);
}
})
.ExposeConfiguration((config) => {
config.SetProperty("adonet.batch_size", "100");
//For mysql Schema update is conflict if there is same TableName and different Database.
//Manual Script Update is required
new SchemaUpdate(config).Execute(true, true);
})
.BuildSessionFactory();
The above Schema update code only work for one Database name with Single Database Server. When I try to Create many database A1, A2... . The Schema Update will not create because of A1 already have Table.
It always said that table found: def.AgentHandler.AppHistory where my target database is "def.A1.AppHistory"
2024-09-03 12:45:23,155 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- NHibernate 5.5.2+39de4d9efca7f653d31f9e04149a5700cfe9e72a (assembly 5.5.0.0)
2024-09-03 12:45:23,166 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- hibernate-configuration section not found in application configuration file
2024-09-03 12:45:23,168 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Bytecode provider name : lcg
2024-09-03 12:45:23,169 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Objects factory class : NHibernate.Bytecode.ActivatorObjectsFactory
2024-09-03 12:45:23,170 [1] INFO NHibernate.Log4NetLogger.Info(:0)- Using reflection optimizer
2024-09-03 12:45:23,256 [1] DEBUG NHibernate.Log4NetLogger.DebugFormat(:0)- Mapping XML:
This discussion was converted from issue #3604 on September 03, 2024 06:28.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It always said that table found: def.AgentHandler.AppHistory where my target database is "def.A1.AppHistory"
2024-09-03 12:45:23,155 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- NHibernate 5.5.2+39de4d9efca7f653d31f9e04149a5700cfe9e72a (assembly 5.5.0.0)
2024-09-03 12:45:23,166 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- hibernate-configuration section not found in application configuration file
2024-09-03 12:45:23,168 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Bytecode provider name : lcg
2024-09-03 12:45:23,169 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Objects factory class : NHibernate.Bytecode.ActivatorObjectsFactory
2024-09-03 12:45:23,170 [1] INFO NHibernate.Log4NetLogger.Info(:0)- Using reflection optimizer
2024-09-03 12:45:23,256 [1] DEBUG NHibernate.Log4NetLogger.DebugFormat(:0)- Mapping XML:
2024-09-03 12:45:23,715 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Mapping class: NHibernateWrapper.Entity.EntityIdentity -> EntityIdentity
2024-09-03 12:45:23,758 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: Id -> Id, type: String
2024-09-03 12:45:23,766 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: CreatedOn -> CreatedOn, type: DateTime
2024-09-03 12:45:23,767 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: UpdatedOn -> UpdatedOn, type: DateTime
2024-09-03 12:45:23,771 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Mapping union-subclass: NHibernateWrapper.Entity.AppHistory -> AppHistory
2024-09-03 12:45:23,772 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: Version -> Version, type: String
2024-09-03 12:45:23,772 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: Created -> Created, type: DateTime
2024-09-03 12:45:23,775 [1] DEBUG NHibernate.Log4NetLogger.DebugFormat(:0)- Mapping XML:
2024-09-03 12:45:23,777 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Mapping class: NHibernateWrapper.Entity.EntityOrder -> EntityOrder
2024-09-03 12:45:23,777 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: Id -> Id, type: String
2024-09-03 12:45:23,778 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: SeqNo -> SeqNo, type: Int32
2024-09-03 12:45:23,779 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: CreatedOn -> CreatedOn, type: DateTime
2024-09-03 12:45:23,780 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Mapped property: UpdatedOn -> UpdatedOn, type: DateTime
2024-09-03 12:45:50,845 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Using dialect: NHibernate.Dialect.MySQL57Dialect
2024-09-03 12:45:50,859 [1] INFO NHibernate.Log4NetLogger.Info(:0)- Running hbm2ddl schema update
2024-09-03 12:45:50,859 [1] INFO NHibernate.Log4NetLogger.Info(:0)- fetching database metadata
2024-09-03 12:45:50,860 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- Initializing connection provider: NHibernate.Connection.DriverConnectionProvider
2024-09-03 12:45:50,861 [1] INFO NHibernate.Log4NetLogger.Info(:0)- Configuring ConnectionProvider
2024-09-03 12:45:50,862 [1] DEBUG NHibernate.Log4NetLogger.Debug(:0)- Obtaining DbConnection from Driver
2024-09-03 12:45:50,876 [1] INFO NHibernate.Log4NetLogger.Info(:0)- updating schema
2024-09-03 12:45:50,878 [1] INFO NHibernate.Log4NetLogger.Info(:0)- checking mappings queue
2024-09-03 12:45:50,879 [1] INFO NHibernate.Log4NetLogger.Info(:0)- processing one-to-many association mappings
2024-09-03 12:45:50,879 [1] INFO NHibernate.Log4NetLogger.Info(:0)- processing one-to-one association property references
2024-09-03 12:45:50,879 [1] INFO NHibernate.Log4NetLogger.Info(:0)- processing foreign key constraints
2024-09-03 12:45:50,880 [1] INFO NHibernate.Log4NetLogger.Info(:0)- processing filters (second pass)
2024-09-03 12:45:51,028 [1] INFO NHibernate.Log4NetLogger.InfoFormat(:0)- table found: def.AgentHandler.AppHistory
Beta Was this translation helpful? Give feedback.
All reactions