lib/zen/task/db.rake in zen-0.2.5 vs lib/zen/task/db.rake in zen-0.2.6
- old
+ new
@@ -1,7 +1,5 @@
-Sequel.extension(:migration)
-
##
# Task group for database related tasks such as migrating and removing the database.
#
# @author Yorick Peterse
# @since 0.2.5
@@ -28,13 +26,13 @@
end
table = 'migrations_package_' + pkg.name.to_s
# Migration time
- Zen::Database.handle.transaction do
- Sequel::Migrator.run(Zen::Database.handle, dir, :table => table)
- puts "Successfully migrated \"#{pkg.name}\""
+ Zen.database.transaction do
+ Sequel::Migrator.run(Zen.database, dir, :table => table)
+ Ramaze::Log.info("Successfully migrated \"#{pkg.name}\"")
end
end
end
desc 'Deletes the entire database'
@@ -59,14 +57,14 @@
end
table = 'migrations_package_' + pkg.name.to_s
# Migration time
- Zen::Database.handle.transaction do
- Sequel::Migrator.run(Zen::Database.handle, dir, :table => table, :target => 0)
- Zen::Database.handle.drop_table(table)
+ Zen.database.transaction do
+ Sequel::Migrator.run(Zen.database, dir, :table => table, :target => 0)
+ Zen.database.drop_table(table)
- puts "Successfully uninstalled \"#{pkg.name}\""
+ Ramaze::Log.info("Successfully uninstalled \"#{pkg.name}\"")
end
end
end
desc 'Creates a default administrator with a random password'