magic_recipes 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/magic_recipes/postgresql.rb +10 -2
- metadata +1 -1
@@ -47,13 +47,21 @@ module MagicRecipes
|
|
47
47
|
end
|
48
48
|
after "deploy:install", "postgresql:install"
|
49
49
|
|
50
|
-
desc "Create a database for this application."
|
50
|
+
desc "Create a database and user for this application."
|
51
51
|
task :create_database, roles: :db, only: {primary: true} do
|
52
|
-
run %Q{#{sudo} -u postgres psql -c "create user #{postgresql_user} with password '#{postgresql_password}';"}
|
52
|
+
#run %Q{#{sudo} -u postgres psql -c "create user #{postgresql_user} with password '#{postgresql_password}';"}
|
53
|
+
# make a superuser .. to be able to install extensions like hstore
|
54
|
+
run %Q{#{sudo} -u postgres psql -c "CREATE ROLE #{postgresql_user} WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD '#{postgresql_password}';"}
|
53
55
|
run %Q{#{sudo} -u postgres psql -c "create database #{postgresql_database} owner #{postgresql_user};"}
|
54
56
|
end
|
55
57
|
after "deploy:setup", "postgresql:create_database"
|
56
58
|
|
59
|
+
desc "Create a postgres-user for this application."
|
60
|
+
task :create_user, roles: :db, only: {primary: true} do
|
61
|
+
# make a superuser .. to be able to install extensions like hstore
|
62
|
+
run %Q{#{sudo} -u postgres psql -c "CREATE ROLE #{postgresql_user} WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD '#{postgresql_password}';"}
|
63
|
+
end
|
64
|
+
|
57
65
|
desc "Generate the database.yml configuration file."
|
58
66
|
task :setup, roles: :app do
|
59
67
|
run "mkdir -p #{shared_path}/config"
|