예제 #1
0
 public void TestRollback()
 {
     Migrator m = new Migrator(Assembly.GetExecutingAssembly(), new SQLiteMigrationFormatter("data source=db.sqlite"));
     m.Rollback();
 }
예제 #2
0
파일: Program.cs 프로젝트: iescarro/rooko
        static void MigrateRollback2(string[] args)
        {
            string command = args[0], assembly = args[1];

            var a = Assembly.LoadFile(Path.Combine(Directory.GetCurrentDirectory(), assembly));
            var config = ConfigurationManager.OpenExeConfiguration(a.Location);
            var connection = config.ConnectionStrings.ConnectionStrings[config.AppSettings.Settings["database"].Value];
            string connectionString = connection.ConnectionString;
            string providerName = connection.ProviderName;
            var m = new Migrator(a, GetMigrationFormatter(providerName, connectionString));
            m.Migrating += delegate(object sender, MigrationEventArgs e) {
                Console.WriteLine(e.Message);
            };

            if (command == "migrate") {
                m.Migrate();
            } else if (command == "rollback") {
                m.Rollback();
            } else {
                throw new NotSupportedException();
            }
        }
예제 #3
0
 public void TestMigrate()
 {
     //			Migrator m = new Migrator(Assembly.GetExecutingAssembly(), new SQLiteMigrationRepository("data source=db.sqlite"));
     Migrator m = new Migrator(Assembly.GetExecutingAssembly(), new SQLiteMigrationFormatter("data source=db.sqlite"));
     m.Migrate();
 }
예제 #4
0
파일: Program.cs 프로젝트: iescarro/rooko
        static void MigrateRollback(string[] args)
        {
            string command = args[0], assembly = args[1], connectionString = args[2], providerName = args[3];

            var m = new Migrator(Assembly.LoadFile(Path.Combine(Directory.GetCurrentDirectory(), assembly)), GetMigrationFormatter(providerName, connectionString));
            m.Migrating += delegate(object sender, MigrationEventArgs e) {
                Console.WriteLine(e.Message);
            };

            if (command == "migrate") {
                m.Migrate();
            } else if (command == "rollback") {
                m.Rollback();
            } else {
                throw new NotSupportedException();
            }
        }