Ejemplo n.º 1
0
 public Database(IDb db, DbQueries dbQueries)
 {
     TableName = dbQueries.TableName.Split('.').Last();
     Schema = dbQueries.Schema;
     _dbQueries = dbQueries;
     _db = db;
 }
Ejemplo n.º 2
0
 private static IMigrationManager CreateMigrationManager(Config config, IDb db, DbQueries queryConfig)
 {
     var database = new Database(db, queryConfig);
     var folder = new DirectoryInfo(config.Directory);
     var scripts = new ScriptFileRepository(folder, config.PreMigration, config.PostMigration);
     var manager = new MigrationManager(scripts, database, Logger);
     return manager;
 }
Ejemplo n.º 3
0
 private static void SaveConfiguration(DbQueries dbQueries)
 {
     var c = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
     var m = (DbMigrationsConfigurationSection) c.GetSection("migrationConfig");
     if (m == null)
     {
         m = new DbMigrationsConfigurationSection();
         c.Sections.Add("migrationConfig", m);
     }
     dbQueries.SaveToConfig(m);
     c.Save(ConfigurationSaveMode.Minimal);
 }