Ejemplo n.º 1
0
        private static JObject BuildMigrationJObject(MigrationDefinition migrationDef)
        {
            JObject migrationObj = new JObject();

            migrationObj.Add(MigrationInfoNameField, migrationDef.Name);
            migrationObj.Add(MigrationInfoDateField, new JValue(DateTime.UtcNow));
            return(migrationObj);
        }
Ejemplo n.º 2
0
        protected virtual void WriteMigrationApplied(MigrationDefinition migrationDef)
        {
            // Get migrations array
            JArray  appliedMigrationsArray = migrationsDoc.Value <JArray>(AppliedMigrationField);
            JObject migrationObj           = BuildMigrationJObject(migrationDef);

            appliedMigrationsArray.Add(migrationObj);

            string newRev = UpdateMigrationsDocument();

            migrationsDoc["_rev"] = new JValue(newRev);
        }
Ejemplo n.º 3
0
 protected override void WriteMigrationApplied(MigrationDefinition migrationDef)
 {
     // We ignore this method for the tests.
 }
 public IMigrationDefinition Create()
 {
     var migrationDefinition = new MigrationDefinition(new NullMigrationDefinition(), payloadVersion, logger);
     migrationDefinition.AddRules(rulesBuilder);
     return migrationDefinition;
 }