Class which provides an easy way to run migrations from a console application
Example #1
0
        static void Main(string[] args)
        {
            var connection = new SQLiteNetConnectionProvider(new SQLiteConnection("SQLiteNetdatabase.sqlite"));
            var versionProvider = new SQLiteNetVersionProvider();

            var migrator = new SimpleMigrator<SQLiteConnection, SQLiteNetMigration>(
                Assembly.GetEntryAssembly(), connection, versionProvider);
            var runner = new ConsoleRunner(migrator);
            runner.Run(args);
        }
Example #2
0
        static void Main(string[] args)
        {
            var migrationsAssembly = typeof(Program).Assembly;
            var db = new SQLiteConnection("DataSource=database.sqlite");
            var versionProvider = new SQLiteVersionProvider();

            var migrator = new SimpleMigrator(migrationsAssembly, db, versionProvider);

            var runner = new ConsoleRunner(migrator);
            runner.Run(args);
        }
Example #3
0
        static void Main(string[] args)
        {
            using (var connection = new SQLiteConnection("SQLiteNetdatabase.sqlite"))
            {
                var databaseProvider = new SQLiteNetDatabaseProvider(connection);

                var migrator = new SimpleMigrator<SQLiteConnection, SQLiteNetMigration>(
                    Assembly.GetEntryAssembly(), databaseProvider);
                var runner = new ConsoleRunner(migrator);
                runner.Run(args);
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            var migrationsAssembly = typeof(Program).Assembly;
            using (var connection = new SQLiteConnection("DataSource=database.sqlite"))
            {
                var databaseProvider = new SqliteDatabaseProvider(connection);

                var migrator = new SimpleMigrator(migrationsAssembly, databaseProvider);

                var runner = new ConsoleRunner(migrator);
                runner.Run(args);
            }
        }