Sha256: a08ca61b192c55934e7622834aa0ca9c1e3e1a7cb90ae5d927e4892d7d19e88c
Contents?: true
Size: 889 Bytes
Versions: 2
Compression:
Stored size: 889 Bytes
Contents
require 'fileutils' namespace :dm do namespace :db do desc "Perform migration using migrations in schema/migrations" task :migrate => :merb_env do #Sequel::Migrator.apply(Merb::Orms::Sequel.connect, "schema/migrations", ENV["VERSION"] ? ENV["VERSION"].to_i : nil) end end namespace :sessions do desc "Creates session migration" task :create => :merb_env do dest = File.join(MERB_ROOT, "schema", "migrations","001_add_sessions_table.rb") source = File.join(File.dirname(__FILE__), "merb", "session","001_add_sessions_table.rb") #FileUtils.cp source, dest unless File.exists?(dest) end desc "Clears sessions" task :clear => :merb_env do table_name = (Merb::Plugins.config[:data_mapper][:session_table_name] || "sessions") #Merb::Orms::DataMapper.connect.execute("DELETE FROM #{table_name}") end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
merb_datamapper-0.4.2 | lib/merb/orms/data_mapper/tasks/databases.rb |
merb_data_mapper-0.4.0 | lib/merb/orms/data_mapper/tasks/databases.rb |