Exemplo n.º 1
0
        private void EnableMigrations(string[] args)
        {
            var criteriaParmas = ParseParams(args);

            var criteria = new EnableMigrationsCriteria
            {
                ProjectPath = criteriaParmas.ProjectPath,
                RepoName = criteriaParmas.OptionalRepoName,
                ConfigFilePath = criteriaParmas.ConfigFilePath,
            };

            var setup = new SchemaSetup();
            setup.EnableMigrations(criteria);
        }
Exemplo n.º 2
0
        private void AddMigration(string[] args)
        {
            var criteriaParmas = ParseParams(args);

            var criteria = new CreationCriteria
            {
                ProjectFileLocation = criteriaParmas.ProjectPath,
                FileName = criteriaParmas.MigrationName,
                RepoName = criteriaParmas.OptionalRepoName,
                ConfigFilePath = criteriaParmas.ConfigFilePath,
            };

            var setup = new SchemaSetup();
            setup.CreateScript(criteria);
        }
Exemplo n.º 3
0
        private void Run()
        {
            CopyDllsForDomainLoadingDebug(@"D:\Development\NHibernateRepoProject\Test\ExampleRepo\bin\debug");

            LoggerBase.IsDebugging = true;
            var setup = new SchemaSetup();

            setup.EnableMigrations(new EnableMigrationsCriteria
            {
                ProjectPath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\examplerepo.csproj",
                RepoName = "SessionRepo",
                ConfigFilePath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\App.config",
            });

            //            var criteria = new CreationCriteria
            //            {
            //                ProjectFileLocation = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\ExampleRepo.csproj",
            //                FileName = "initial_Setup-Models",
            //                RepoName = "examplerepo",
            //                ConfigFilePath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\App.config"
            //            };
            //            setup.CreateScript(criteria);

            //            var criteria = new CreationCriteria
            //            {
            //                ProjectFileLocation = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\ExampleRepo.csproj",
            //                FileName = "Age_added",
            //                RepoName = "ExampleRepo",
            //                ConfigFilePath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\App.config"
            //            };
            //            setup.CreateScript(criteria);

            //                var crit = new ApplyMigrationCriteria
            //                {
            //                    ProjectPath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\ExampleRepo.csproj",
            //                    RepoName = "ExampleRepo",
            //                    ConfigFilePath = @"D:\Development\NHibernateRepoProject\Test\ExampleRepo\App.config"
            //                };
            //
            //                setup.ApplyMigrations(crit);
        }
Exemplo n.º 4
0
        private void UpdateDatabase(string[] args)
        {
            var criteriaParmas = ParseParams(args);

            var criteria = new ApplyMigrationCriteria
            {
                ProjectPath = criteriaParmas.ProjectPath,
                RepoName = criteriaParmas.OptionalRepoName,
                ConfigFilePath = criteriaParmas.ConfigFilePath,
            };

            var setup = new SchemaSetup();
            setup.ApplyMigrations(criteria);
        }