Exemplo n.º 1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (string.IsNullOrEmpty(this.OutputFile))
            {
                this.WriteError(new ErrorRecord(new PSInvalidOperationException(
                    "Missing a file for output"),
                    "NoOutputFile",
                    ErrorCategory.MetadataError,
                    null));

                return;
            }

            var dbDeploy = new DbDeployer
            {
                InfoWriter = new LambdaTextWriter(WriteVerbose),
                Dbms = this.DatabaseType,
                ConnectionString = this.ConnectionString,
                ChangeLogTableName = this.TableName,
                ScriptDirectory = new DirectoryInfo(this.deltasDirectory),
            };

            dbDeploy.OutputFile = new FileInfo(this.ToAbsolutePath(OutputFile));

            if (!string.IsNullOrEmpty(this.UndoOutputFile))
            {
                dbDeploy.OutputFile = new FileInfo(this.ToAbsolutePath(UndoOutputFile));
            }

            dbDeploy.Go();
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var dbDeploy = new DbDeployer
            {
                InfoWriter = new LambdaTextWriter(WriteVerbose),
                Dbms = DatabaseType,
                ConnectionString = ConnectionString,
                ChangeLogTableName = TableName,
                ScriptDirectory = new DirectoryInfo(deltasDirectory),
            };

            dbDeploy.Go();
        }