Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public void CreateTables()
 {
     _schemaManager.CreateInitialStructure();
 }