/// <summary> /// Executes the specified script to create/drop/change the database schema /// </summary> public static void CreateSchemaFromFile(String scriptFileName) { CheckInitialized(); ARSchemaCreator arschema = new ARSchemaCreator( ActiveRecordBase._holder.GetConfiguration(typeof(ActiveRecordBase))); arschema.Execute(scriptFileName); }
/// <summary> /// Executes the specified script to create/drop/change the database schema /// against the specified database connection /// </summary> public static void CreateSchemaFromFile(String scriptFileName, IDbConnection connection) { CheckInitialized(); if (connection == null) { throw new ArgumentNullException("connection"); } String[] parts = ARSchemaCreator.OpenFileAndStripContents(scriptFileName); ARSchemaCreator.ExecuteScriptParts(connection, parts); }