Class: SchemaEvolutionManager::MigrationFile

Inherits:
Object
  • Object
show all
Defined in:
lib/schema-evolution-manager/migration_file.rb

Overview

Represents a single file to make a schema migration, typically stored in the scripts subdirectory.

Defined Under Namespace

Classes: Attribute, AttributeValue

Constant Summary collapse

DEFAULTS =
[AttributeValue.new("transaction", "single")]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ MigrationFile

Returns a new instance of MigrationFile.



49
50
51
52
53
# File 'lib/schema-evolution-manager/migration_file.rb', line 49

def initialize(path)
  @path = path
  Preconditions.check_state(File.exist?(@path), "File[#{@path}] does not exist")
  @attribute_values = parse_attribute_values
end

Instance Attribute Details

#attribute_valuesObject (readonly)

Returns the value of attribute attribute_values.



47
48
49
# File 'lib/schema-evolution-manager/migration_file.rb', line 47

def attribute_values
  @attribute_values
end

#pathObject (readonly)

Returns the value of attribute path.



47
48
49
# File 'lib/schema-evolution-manager/migration_file.rb', line 47

def path
  @path
end