Exception: SchemaEvolutionManager::ScriptError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db, filename) ⇒ ScriptError

Returns a new instance of ScriptError.



7
8
9
10
# File 'lib/schema-evolution-manager/script_error.rb', line 7

def initialize(db, filename)
  @db = Preconditions.assert_class(db, Db)
  @filename = Preconditions.assert_class(filename, String)
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/schema-evolution-manager/script_error.rb', line 5

def filename
  @filename
end

Instance Method Details

#dmlObject



12
13
14
15
# File 'lib/schema-evolution-manager/script_error.rb', line 12

def dml
  sql_command = "insert into %s.%s (filename) values ('%s')" % [Db.schema_name, Scripts::SCRIPTS, filename]
  "psql --command \"%s\" %s" % [sql_command, @db.url]
end