Sha256: d7baf117257fce77a53d0e8b34ccac32904afcbad4d67eefef813d2e1571522a

Contents?: true

Size: 1.08 KB

Versions: 59

Compression:

Stored size: 1.08 KB

Contents

#################
##     SETTINGS FOR DATABASES
#
# this file contains common settings and rake tasks for ORM gems.
#
# please review / edit the settings you need.
# 
############
## DataMapper
# more info @:
# http://datamapper.org
if defined? DataMapper
  # If you want the logs...
  DataMapper::Logger.new(Plezi.logger, :debug)
  
  if defined? SQLite3
    # An in-memory Sqlite3 connection:
    DataMapper.setup(:default, 'sqlite::memory:')

    # A Sqlite3 connection to a persistent database
    DataMapper.setup(:default, "sqlite:///#{Root.join('db', 'db.sqlite3').to_s}")
  elsif defined? PG
    # A Postgres connection:
    if ENV['DYNO']
      DataMapper.setup(:default, ENV['HEROKU_POSTGRESQL_RED_URL'])
    else
      Root.to_s.split(/\/\\/).last
      DataMapper.setup(:default, "postgres://localhost/#{Root.to_s.split(/[\/\\]/).last}")
    end
  end
  if defined? Rake
##########
# start rake segment

namespace :db do
  take :rebuild do
    DataMapper.finalize.auto_migrate!
  end
  task :migrate do
    DataMapper.finalize.auto_upgrade!
  end
  
end

# end rake segment
##########
  end

end


Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
plezi-0.12.22 resources/db_dm_config.rb
plezi-0.12.21 resources/db_dm_config.rb
plezi-0.12.20 resources/db_dm_config.rb
plezi-0.12.19 resources/db_dm_config.rb
plezi-0.12.18 resources/db_dm_config.rb
plezi-0.12.17 resources/db_dm_config.rb
plezi-0.12.16 resources/db_dm_config.rb
plezi-0.12.15 resources/db_dm_config.rb
plezi-0.12.14 resources/db_dm_config.rb
plezi-0.12.13 resources/db_dm_config.rb
plezi-0.12.11 resources/db_dm_config.rb
plezi-0.12.10 resources/db_dm_config.rb
plezi-0.12.9 resources/db_dm_config.rb
plezi-0.12.8 resources/db_dm_config.rb
plezi-0.12.7 resources/db_dm_config.rb
plezi-0.12.6 resources/db_dm_config.rb
plezi-0.12.5 resources/db_dm_config.rb
plezi-0.12.4 resources/db_dm_config.rb
plezi-0.12.3 resources/db_dm_config.rb
plezi-0.12.2 resources/db_dm_config.rb