class FluentMigratorCommandRunner::MigrationCommand
Constants
- CONNECTION_STRING_DELIMITER
- MIGRATOR_DELIMITER
- PARAMETER_PREFIX
- SPACE_CHAR
Attributes
connection_information[R]
path_to_migration_assembly[R]
path_to_migrator[R]
profile[R]
provider[R]
tag[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/fluent-migrator-command-runner/commands/migration_command.rb, line 16 def initialize(options = {}) @profile = options[:profile] unless options[:profile].nil? @tag = options[:tag] unless options[:tag].nil? @provider = FigNewton.migration_provider('oracle') @path_to_migrator = FigNewton.path_to_migrator_exe @path_to_migration_assembly = FigNewton.path_to_migration_assembly @connection_information = FigNewton.database.to_hash @connection_information['password'] = options[:db_password] unless options[:db_password].nil? end
Public Instance Methods
build()
click to toggle source
# File lib/fluent-migrator-command-runner/commands/migration_command.rb, line 26 def build connection_string = build_connection_string(@connection_information) command_sections = [] command_sections.push(@path_to_migrator) command_sections.push("provider #{@provider}") command_sections.push("conn \"#{connection_string}\"") command_sections.push('task migrate') command_sections.push("assembly \"#{@path_to_migration_assembly}\"") command_sections.push("tag #{@tag}") if @tag command_sections.push("profile=#{@profile}") if @profile command_sections.join(MIGRATOR_DELIMITER) end