Class: DatabasePatcher::PatchEntity::File

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

Instance Method Summary collapse

Methods inherited from DatabasePatcher::PatchEntity

#accepted_extensions, #execute_file, #extract_comments, factory, #get_comment, #initialize, #md5, #patch_record, #raise_unknown_extension_for, #register_this_patch, #timestamp, #uniq_indentifier, #unregister_this_patch

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