Skip to content

olibanjoli/RavenDb.Migrations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages