diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-08-02 14:22:10 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-08-02 20:54:50 +0200 |
commit | 3d1ebd849cc698717ae1c0109a6eaa5614a15a7f (patch) | |
tree | 7f788716228907fd4ef36673a2eacf9294879d7f | |
parent | Make tests pass on MySQL (diff) | |
download | recruiting-webapp-3d1ebd849cc698717ae1c0109a6eaa5614a15a7f.tar.gz recruiting-webapp-3d1ebd849cc698717ae1c0109a6eaa5614a15a7f.tar.bz2 recruiting-webapp-3d1ebd849cc698717ae1c0109a6eaa5614a15a7f.zip |
Rake prepare task to can prepare MySQL configuration
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | doc/config/database-mysql.yml | 12 | ||||
-rw-r--r-- | lib/tasks/prepare.rake | 7 |
3 files changed, 19 insertions, 2 deletions
@@ -24,7 +24,7 @@ or if you want to run tests rake prepare - You can pass db=sqlite3 or db=postgres if you want rake to prepare database configuration for you. + You can pass db=sqlite3, db=postgres or db=mysql if you want rake to prepare database configuration for you. You can pass seed= if you want rake to seed you database with example data. 5. (Optional) You can run test I prepared by simply issuing diff --git a/doc/config/database-mysql.yml b/doc/config/database-mysql.yml new file mode 100644 index 0000000..26347e8 --- /dev/null +++ b/doc/config/database-mysql.yml @@ -0,0 +1,12 @@ +development: + adapter: mysql + username: + password: + database: +test: &test + adapter: mysql + username: + password: + database: +cucumber: + <<: *test diff --git a/lib/tasks/prepare.rake b/lib/tasks/prepare.rake index f28826e..bc46a43 100644 --- a/lib/tasks/prepare.rake +++ b/lib/tasks/prepare.rake @@ -7,7 +7,7 @@ task :prepare => ['prepare:config', 'db:schema:load'] + opt namespace :prepare do - desc "Prepare configuration files (you can pass db=[none|sqlite3|postgres])" + desc "Prepare configuration files (you can pass db=[none|sqlite3|postgres|mysql])" task :config do if !ENV.include?('db') || (ENV['db'] == 'none') @@ -21,6 +21,11 @@ namespace :prepare do puts "Now you have a template postgeres configuration in config/database.yml. Remember to set user and database names matching you configuration." + elsif ENV['db'] == 'mysql' + File.copy('doc/config/database-mysql.yml', 'config/database.yml') + puts "Now you have a template mysql configuration in config/database.yml. + Remember to set user and database names matching you configuration." + else raise "valid values for db are sqlite3, postgres, none" end |