public void CreateDatabase() { using (var con = ConnectionFactory.CreateConnection()) { _dbName = "T" + Guid.NewGuid().ToString("N"); con.ExecuteNonQuery("CREATE Database " + _dbName); con.ChangeDatabase(_dbName); var schemaTool = new SchemaManager(() => con); schemaTool.CreateInitialStructure(); } }
public void InitSchema() { if (_invoked) { throw new InvalidOperationException("Already invoked."); } _invoked = true; try { var schemaManager = new SchemaManager(OpenConnection); schemaManager.CreateInitialStructure(); if (UpdateToLatestVersion) { schemaManager.UpgradeDatabaseSchema(); } } catch (SqlException ex) { throw new DataException(_databaseName + " [" + ConnectionString + "] schema init failed.", ex); } }
public void CreateTables() { _schemaManager.CreateInitialStructure(); }