コード例 #1
0
        public SqlServerFixture() : base(new SqlConnection(CreateConnectionString()), new SqlServerDialect())
        {
            var runner = new SqlServerMigrationRunner(Connection.ConnectionString);

            runner.CreateDatabaseIfNotExists();
            runner.MigrateUp(typeof(TMigrationInfo).Assembly, typeof(TMigrationInfo).Namespace);
        }
コード例 #2
0
        private static void MigrateToLatest(string connectionString, RuntimeOptions options)
        {
            var runner = new SqlServerMigrationRunner(connectionString);

            if (options.CreateIfNotExists)
            {
                runner.CreateDatabaseIfNotExists();
            }

            if (options.MigrateOnStartup)
            {
                runner.MigrateUp(typeof(CreateIdentitySchema).Assembly, typeof(CreateIdentitySchema).Namespace);
            }
        }