Class: Rails::DataMapper::Storage::Mysql

Inherits:
Rails::DataMapper::Storage show all
Defined in:
lib/dm-rails/storage.rb

Instance Attribute Summary

Attributes inherited from Rails::DataMapper::Storage

#config, #name

Instance Method Summary collapse

Methods inherited from Rails::DataMapper::Storage

#charset, #create, create_all, create_environment, #create_message, #database, #drop, drop_all, drop_environment, #drop_message, #initialize, new, #password, #username

Constructor Details

This class inherits a constructor from Rails::DataMapper::Storage

Instance Method Details

#_createObject



159
160
161
# File 'lib/dm-rails/storage.rb', line 159

def _create
  execute("CREATE DATABASE `#{database}` DEFAULT CHARACTER SET #{charset} DEFAULT COLLATE #{collation}")
end

#_dropObject



163
164
165
# File 'lib/dm-rails/storage.rb', line 163

def _drop
  execute("DROP DATABASE IF EXISTS `#{database}`")
end