コード例 #1
0
        internal FxVersionLoader(IMigrationRunner runner, IAssemblyCollection assemblies,
                                 IConventionSet conventionSet,
                                 IMigrationRunnerConventions conventions,
                                 IRunnerContext runnerContext,
                                 IVersionTableMetaData versionTableMetaData = null,
                                 string resource = "")
        {
            _conventionSet = conventionSet;
            _processor     = runner.Processor;

            Runner     = runner;
            Assemblies = assemblies;

            Conventions                 = conventions;
            VersionTableMetaData        = versionTableMetaData ?? CreateVersionTableMetaData(runnerContext);
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);
            VersionResourceMigration    = new VersionResourceMigration(VersionTableMetaData);

            VersionTableMetaData.ApplicationContext = runnerContext.ApplicationContext;

            Resource = resource;

            LoadVersionInfo();
        }
コード例 #2
0
        internal ConnectionlessVersionLoader(
            IMigrationRunner runner,
            IAssemblyCollection assemblies,
            IConventionSet conventionSet,
            IMigrationRunnerConventions conventions,
            IRunnerContext runnerContext,
            IVersionTableMetaData versionTableMetaData = null)
        {
            _migrationInformationLoader = runner.MigrationLoader;
            _processor = runner.Processor;

            Runner        = runner;
            Assemblies    = assemblies;
            Conventions   = conventions;
            StartVersion  = runnerContext.StartVersion;
            TargetVersion = runnerContext.Version;

            VersionInfo          = new VersionInfo();
            VersionTableMetaData = versionTableMetaData ??
                                   (IVersionTableMetaData)Activator.CreateInstance(assemblies.Assemblies.GetVersionTableMetaDataType(
                                                                                       Conventions, runnerContext));
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            if (VersionTableMetaData is DefaultVersionTableMetaData defaultMetaData)
            {
                conventionSet.SchemaConvention?.Apply(defaultMetaData);
            }

            LoadVersionInfo();
        }
コード例 #3
0
        public FxVersionLoader(
            IProcessorAccessor processorAccessor,
            IConventionSet conventionSet,
            IMigrationRunnerConventions conventions,
            IVersionTableMetaData versionTableMetaData,
            IMigrationRunner runner,
            string resource = "")
        {
            _conventionSet = conventionSet;
            _processor     = processorAccessor.Processor;

            Runner = runner;

            Conventions                 = conventions;
            VersionTableMetaData        = versionTableMetaData;
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);
            VersionResourceMigration    = new VersionResourceMigration(VersionTableMetaData);

            Resource = resource;

            LoadVersionInfo();
        }
コード例 #4
0
        public VersionLoader(IMigrationRunner runner, Assembly assembly, IMigrationConventions conventions)
        {
            Runner    = runner;
            Processor = runner.Processor;
            Assembly  = assembly;

            Conventions                 = conventions;
            VersionTableMetaData        = GetVersionTableMetaData();
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);
        }
コード例 #5
0
        public VersionLoader(IMigrationRunner runner, IAssemblyCollection assemblies, IMigrationConventions conventions)
        {
            Runner     = runner;
            Processor  = runner.Processor;
            Assemblies = assemblies;

            Conventions                 = conventions;
            VersionTableMetaData        = GetVersionTableMetaData();
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #6
0
        public VersionLoader(IMigrationRunner runner, Assembly assembly, IMigrationConventions conventions, string group)
        {
            Runner    = runner;
            Processor = runner.Processor;
            Assembly  = assembly;
            Group     = group;

            Conventions            = conventions;
            VersionTableMetaData   = GetVersionTableMetaData();
            VersionMigration       = new VersionMigration(VersionTableMetaData);
            GroupVersionMigration  = new VersionGroupMigration(VersionTableMetaData);
            VersionSchemaMigration = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration = new VersionUniqueMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #7
0
        public ConnectionlessVersionLoader(IMigrationRunner runner, IAssemblyCollection assemblies, IMigrationConventions conventions, long startVersion, long targetVersion)
        {
            Runner        = runner;
            Assemblies    = assemblies;
            Conventions   = conventions;
            StartVersion  = startVersion;
            TargetVersion = targetVersion;

            Processor = Runner.Processor;

            VersionInfo                 = new VersionInfo();
            VersionTableMetaData        = GetVersionTableMetaData();
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #8
0
        public VersionLoader(IMigrationRunner runner, IAssemblyCollection assemblies,
                             IConventionSet conventionSet,
                             IMigrationRunnerConventions conventions,
                             IVersionTableMetaData versionTableMetaData = null)
        {
            _conventionSet = conventionSet;
            Runner         = runner;
            Processor      = runner.Processor;
            Assemblies     = assemblies;

            Conventions                 = conventions;
            VersionTableMetaData        = versionTableMetaData ?? GetVersionTableMetaData();
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #9
0
        public VersionLoader(
            [NotNull] IProcessorAccessor processorAccessor,
            [NotNull] IConventionSet conventionSet,
            [NotNull] IMigrationRunnerConventions conventions,
            [NotNull] IVersionTableMetaData versionTableMetaData,
            [NotNull] IMigrationRunner runner)
        {
            _conventionSet = conventionSet;
            _processor     = processorAccessor.Processor;

            Runner = runner;

            Conventions                 = conventions;
            VersionTableMetaData        = versionTableMetaData;
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #10
0
        public ConnectionlessVersionLoader(
            [NotNull] IProcessorAccessor processorAccessor,
            [NotNull] IMigrationRunnerConventions conventions,
            [NotNull] IOptions <RunnerOptions> runnerOptions,
            [NotNull] IMigrationInformationLoader migrationInformationLoader,
            [NotNull] IVersionTableMetaData versionTableMetaData)
        {
            _processor = processorAccessor.Processor;
            _migrationInformationLoader = migrationInformationLoader;
            Conventions   = conventions;
            StartVersion  = runnerOptions.Value.StartVersion;
            TargetVersion = runnerOptions.Value.Version;

            VersionInfo                 = new VersionInfo();
            VersionTableMetaData        = versionTableMetaData;
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            LoadVersionInfo();
        }
コード例 #11
0
        internal VersionLoader(IMigrationRunner runner, IAssemblyCollection assemblies,
                               [NotNull] IConventionSet conventionSet,
                               [NotNull] IMigrationRunnerConventions conventions,
                               [NotNull] IRunnerContext runnerContext,
                               [CanBeNull] IVersionTableMetaData versionTableMetaData = null)
        {
            _conventionSet = conventionSet;
            _processor     = runner.Processor;

            Runner     = runner;
            Assemblies = assemblies;

            Conventions                 = conventions;
            VersionTableMetaData        = versionTableMetaData ?? CreateVersionTableMetaData(runnerContext);
            VersionMigration            = new VersionMigration(VersionTableMetaData);
            VersionSchemaMigration      = new VersionSchemaMigration(VersionTableMetaData);
            VersionUniqueMigration      = new VersionUniqueMigration(VersionTableMetaData);
            VersionDescriptionMigration = new VersionDescriptionMigration(VersionTableMetaData);

            VersionTableMetaData.ApplicationContext = runnerContext.ApplicationContext;

            LoadVersionInfo();
        }