scrolls/mysql.rb in appscrolls-0.7.1 vs scrolls/mysql.rb in appscrolls-0.8.0
- old
+ new
@@ -1,31 +1,24 @@
gem "mysql2"
-# TODO what about Windows?
+if scroll?("eycloud")
+ @db_stack = "mysql"
+end
-# if scroll?("eycloud")
-# mysql_versions = [
-# ["MySQL 5.0", "mysql_50"],
-# ["MySQL 5.5 (beta)", "mysql_55"]
-# ]
-# @mysql_stack = multiple_choice("Create app to which Engine Yard Cloud account?", mysql_versions)
-# end
-
after_bundler do
rake "db:create:all" if config['auto_create']
- if config['populate_rake_task']
- sample_rake = <<-RUBY
-require './config/environment'
+ rakefile("sample.rake") do
+<<-RUBY
namespace :db do
desc "Populate the database with sample data"
- task :sample do
+ task :sample => :environment do
+
end
task :populate => :sample
end
RUBY
- File.open("lib/tasks/sample.rake", 'w') {|f| f.write(sample_rake)}
end
end
__END__
@@ -41,11 +34,6 @@
args: -d mysql
config:
- auto_create:
type: boolean
- prompt: "Create MySQL database with default configuration?"
-
- - populate_rake_task:
- type: boolean
- prompt: "Add db:sample rake task?"
-
+ prompt: "Create local MySQL databases with default configuration?"