public MigrationScopeRulesVerb(IMigrationRules rules, IMigrationDefinition definition, IVersionQualifier versionQualifier, ILogger logger) { this.rules = rules; this.definition = definition; this.versionQualifier = versionQualifier; this.logger = logger; }
public async Task SetUpAsync(IMigrationDefinition migrationDefinition, CancellationToken cancellationToken = default) { var name = NormalizeName(migrationDefinition.Name); await collection.InsertOneAsync(new MigrationDocument { Name = name, Date = DateTime.UtcNow, Description = migrationDefinition.Description }, cancellationToken : cancellationToken); }
public async Task SetDownAsync(IMigrationDefinition migrationDefinition, CancellationToken cancellationToken = default) { var name = NormalizeName(migrationDefinition.Name); var result = await collection.DeleteOneAsync(it => it.Name == name, cancellationToken : cancellationToken); if (result.DeletedCount != 1) { throw new InvalidOperationException(); } }
public void AddChild(IVersionQualifier qualifier, IMigrationDefinition childDefinition) { var childList = (versionComparer.Compare(qualifier.StartVersion, fromVersion) >= 0) ? childDefinitions : outOfScopeChildDefinitions; try { childList.Add(qualifier, childDefinition); } catch (ArgumentException exception) { throw new MigrationConfigurationException( string.Format("Duplicate version {0} scopes", qualifier.StartVersion), exception); } }
public DataType(Type type, IMigrationDefinition migrationDefiniton) { this.type = type; this.migrationDefiniton = migrationDefiniton; }
internal MigrationRules(IMigrationDefinition definition, Version fromVersion, ILogger logger) { this.definition = definition; this.fromVersion = fromVersion; this.logger = logger; }
public void SetMigration(IMigrationDefinition definition) { migrationDefiniton = definition; }
public TypeNameMapper(IMigrationDefinition migrationDefinition) { this.migrationDefinition = migrationDefinition; }
public FieldMigrator(IMigrationDefinition migrationDefinition) { this.migrationDefinition = migrationDefinition; }
public MigrationTypeFinder(ITypeFinder typeFinder, IMigrationDefinition migrationDefinition) { this.typeFinder = typeFinder; this.migrationDefinition = migrationDefinition; }
public void AddChild(IVersionQualifier qualifier, IMigrationDefinition childDefinition) { throw new InvalidOperationException(); }
public MigrationDefinition(IMigrationDefinition parentDefinition, Version fromVersion, ILogger logger) { this.parentDefinition = parentDefinition; this.fromVersion = fromVersion; this.logger = logger; }
public async Task <bool> IsAppliedAsync(IMigrationDefinition migrationDefinition, CancellationToken cancellationToken = default) { var name = NormalizeName(migrationDefinition.Name); return(await(await collection.FindAsync(it => it.Name == name, cancellationToken: cancellationToken)).AnyAsync(cancellationToken)); }