magic_recipes 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/magic_recipes/db.rb +13 -0
- metadata +1 -1
data/lib/magic_recipes/db.rb
CHANGED
@@ -32,6 +32,19 @@ module MagicRecipes
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
desc "delete all tables of the database"
|
36
|
+
task :delete_tables do
|
37
|
+
if use_rvm
|
38
|
+
run <<-CMD
|
39
|
+
#{rvm_cmd} &&
|
40
|
+
cd #{latest_release} &&
|
41
|
+
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.drop_table t }
|
42
|
+
CMD
|
43
|
+
else
|
44
|
+
run "cd #{latest_release} && ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.drop_table t }"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
35
48
|
end
|
36
49
|
|
37
50
|
# eof
|