Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 1018 Bytes

README.md

File metadata and controls

34 lines (30 loc) · 1018 Bytes

Introduction

Migration framework for RavenDB 4. This library is currently work in progress. It implements a journaling mechanism which ensures that migrations are applied in the correct order and only once. In future helpers will be added like scripted updates etc.

Implementing Migrations

    public class _0001_First_Migration : DatabaseMigration
    {
        public override void Up(IDocumentStore store)
        {
            // do your migration using store
        }
    }

Run Migrations

  class Program
  {
    static void Main(string[] args)
    {
      var store = new DocumentStore
      {
          Urls = new[] {"http://localhost:8081"},
          Database = "Playground"
      };

      var migrator = new Migrator(store);
      migrator.Run(typeof(Program).Assembly); // assembly where migrations are implemented
    }
  }

Ordering of Migrations

Migrations are order by class name (string ordering). Use number prefixes to control the order as seen in the examples.