Class: DatabasePatcher::PatchEntity::File

Inherits:
DatabasePatcher::PatchEntity show all
Defined in:
lib/database_patcher/patch_entity/file.rb

Constant Summary

Constants inherited from DatabasePatcher::PatchEntity

UUID_MATCHER

Instance Attribute Summary

Attributes inherited from DatabasePatcher::PatchEntity

#interface, #path

Instance Method Summary collapse

Methods inherited from DatabasePatcher::PatchEntity

factory, #initialize, #timestamp, #uniq_indentifier, #uuid

Constructor Details

This class inherits a constructor from DatabasePatcher::PatchEntity

Instance Method Details

#commentObject



20
21
22
# File 'lib/database_patcher/patch_entity/file.rb', line 20

def comment
  get_comment(@path)
end

#down(connection) ⇒ Object



8
9
10
# File 'lib/database_patcher/patch_entity/file.rb', line 8

def down(connection)
  unregister_this_patch(connection)
end

#md5_downObject



12
13
14
# File 'lib/database_patcher/patch_entity/file.rb', line 12

def md5_down
  ''
end

#md5_upObject



16
17
18
# File 'lib/database_patcher/patch_entity/file.rb', line 16

def md5_up
  md5(::File.read(@path))
end

#up(connection) ⇒ Object



3
4
5
6
# File 'lib/database_patcher/patch_entity/file.rb', line 3

def up(connection)
  execute_file(connection, @path)
  register_this_patch(connection)
end