Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

There is em_postgresql also.

  • Loading branch information...
commit 397c9f997accfc925a7ca6469aea439c497c4cf3 1 parent 7cfa388
Denis authored January 14, 2013
8  padrino-gen/lib/padrino-gen/padrino-tasks/activerecord.rb
@@ -69,7 +69,7 @@ def create_database(config)
69 69
             $stderr.puts "Couldn't create database for #{config.inspect}, charset: #{config[:charset] || @charset}, collation: #{config[:collation] || @collation}"
70 70
             $stderr.puts "(if you set the charset manually, make sure you have a matching collation)" if config[:charset]
71 71
           end
72  
-        when 'postgresql'
  72
+        when 'postgresql', 'em_postgresql'
73 73
           @encoding = config[:encoding] || ENV['CHARSET'] || 'utf8'
74 74
           begin
75 75
             ActiveRecord::Base.establish_connection(config.merge(:database => 'postgres', :schema_search_path => 'public'))
@@ -187,7 +187,7 @@ def local_database?(config, &block)
187 187
       when 'mysql', 'mysql2', 'jdbcmysql'
188 188
         ActiveRecord::Base.establish_connection(config)
189 189
         puts ActiveRecord::Base.connection.charset
190  
-      when 'postgresql'
  190
+      when 'postgresql', 'em_postgresql'
191 191
         ActiveRecord::Base.establish_connection(config)
192 192
         puts ActiveRecord::Base.connection.encoding
193 193
       else
@@ -259,7 +259,7 @@ def local_database?(config, &block)
259 259
         when "mysql", "mysql2", "oci", "oracle", 'jdbcmysql'
260 260
           ActiveRecord::Base.establish_connection(abcs[Padrino.env])
261 261
           File.open("#{Padrino.root}/db/#{Padrino.env}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
262  
-        when "postgresql"
  262
+        when "postgresql", "em_postgresql"
263 263
           ENV['PGHOST']     = abcs[Padrino.env][:host] if abcs[Padrino.env][:host]
264 264
           ENV['PGPORT']     = abcs[Padrino.env][:port].to_s if abcs[Padrino.env][:port]
265 265
           ENV['PGPASSWORD'] = abcs[Padrino.env][:password].to_s if abcs[Padrino.env][:password]
@@ -346,7 +346,7 @@ def drop_database(config)
346 346
       file = path.absolute? ? path.to_s : Padrino.root(path)
347 347
 
348 348
       FileUtils.rm(file)
349  
-    when 'postgresql'
  349
+    when 'postgresql', 'em_postgresql'
350 350
       ActiveRecord::Base.establish_connection(config.merge(:database => 'postgres', :schema_search_path => 'public'))
351 351
       ActiveRecord::Base.connection.drop_database config[:database]
352 352
     end

0 notes on commit 397c9f9

Please sign in to comment.
Something went wrong with that request. Please try again.