Skip to content

Commit

Permalink
Merge pull request #38 from capistrano-plugins/4.4.1
Browse files Browse the repository at this point in the history
Moved back to CREATE USER instead of CREATE ROLE due to LOGIN rejection
  • Loading branch information
NorseGaud authored Oct 26, 2017
2 parents 9980bb3 + cd5c818 commit c40a5ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/capistrano/postgresql/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Capistrano
module Postgresql
VERSION = "4.4.0"
VERSION = "4.5.0"
end
end
3 changes: 2 additions & 1 deletion lib/capistrano/tasks/postgresql.rake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ namespace :postgresql do
task :create_db_user do
on roles :db do
next if db_user_exists? fetch(:pg_user)
unless psql_simple '-c', %Q{"CREATE ROLE \\"#{fetch(:pg_user)}\\" PASSWORD '#{fetch(:pg_password)}';"}
# If you use CREATE USER instead of CREATE ROLE the LOGIN right is granted automatically; otherwise you must specify it in the WITH clause of the CREATE statement.
unless psql_simple '-c', %Q{"CREATE USER \\"#{fetch(:pg_user)}\\" PASSWORD '#{fetch(:pg_password)}';"}
error 'postgresql: creating database user failed!'
exit 1
end
Expand Down

0 comments on commit c40a5ea

Please sign in to comment.