lib/ronin/database/database.rb in ronin-1.0.0.rc2 vs lib/ronin/database/database.rb in ronin-1.0.0.rc3

- old
+ new

@@ -17,14 +17,12 @@ # along with Ronin. If not, see <http://www.gnu.org/licenses/>. # require 'ronin/database/exceptions/invalid_config' require 'ronin/database/exceptions/unknown_repository' -require 'ronin/database/migrations/migrations' -require 'ronin/model' +require 'ronin/database/migrations' require 'ronin/config' -require 'ronin/installation' require 'addressable/uri' require 'yaml' require 'dm-core' @@ -186,29 +184,22 @@ end # # Sets up the Database. # - # @yield [] - # The block to call after the Database has been setup, but before - # it is updated. - # # @see Database.upgrade! # - def Database.setup(&block) + def Database.setup # setup the database log Database.setup_log unless @log # setup the database repositories Database.repositories.each do |name,uri| DataMapper.setup(name,uri) end - # auto-upgrade the database repository - Database.upgrade!(&block) - - # finalize the model relationships - DataMapper.finalize + # apply any new migrations to the database + Database.upgrade! end # # Performs Database transactions within a given repository. #