Search Results for

    Show / Hide Table of Contents

    API for version 3.x

    Using the in-process runner

    // Create the announcer to output the migration messages
    var announcer = new ConsoleAnnouncer();
    
    // Processor specific options (usually none are needed)
    var options = new ProcessorOptions();
    
    // Use SQLite
    var processorFactory = new SQLiteProcessorFactory();
    
    // Initialize the processor
    using (var processor = processorFactory.Create(
        // The SQLite connection string
        "Data Source=test.db",
        announcer,
        options))
    {
        // Configure the runner
        var context = new RunnerContext(announcer);
    
        // Create the migration runner
        var runner = new MigrationRunner(
            // Specify the assembly with the migrations
            typeof(MyMigration).Assembly,
            context,
            processor);
    
        // Run the migrations
        runner.MigrateUp();
    }
    
    • Edit this page
    In this article
    Back to top
    Copyright © 2018 Fluent Migrator Project
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.