From d0a8e9b3eb82176faec6896af3eb0333e794962f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 6 Jun 2014 16:58:44 +0100 Subject: Use template for setting up postgres databases Seems to be the cleanest way for ensuring databases are always created with UTF-8 encoding, if for example the admin has not configured the system locale. --- docs/installing/macos.md | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'docs/installing/macos.md') diff --git a/docs/installing/macos.md b/docs/installing/macos.md index c46bdf4ba..bdb4c90d8 100644 --- a/docs/installing/macos.md +++ b/docs/installing/macos.md @@ -88,17 +88,27 @@ The following is mostly from [the manual installation process]({{ site.baseurl}} ### Configure database -Creates Alaveteli databases and an `foi` user with password `foi`. - - echo "CREATE DATABASE foi_development encoding = 'UTF8'; - CREATE DATABASE foi_test encoding = 'UTF8'; - CREATE USER foi WITH CREATEUSER; - ALTER USER foi WITH PASSWORD 'foi'; - ALTER USER foi WITH CREATEDB; - GRANT ALL PRIVILEGES ON DATABASE foi_development TO foi; - GRANT ALL PRIVILEGES ON DATABASE foi_test TO foi; - ALTER DATABASE foi_development OWNER TO foi; - ALTER DATABASE foi_test OWNER TO foi;" | psql -h localhost template1 +Create a database for your Mac user as homebrew doesn't create one by default: + + createdb + +Create a `foi` user from the command line, like this: + + createuser -s -P foi + +_Note:_ Leaving the password blank will cause great confusion if you're new to +PostgreSQL. + +We'll create a template for our Alaveteli databases: + + createdb -T template0 -E UTF-8 template_utf8 + echo "update pg_database set datistemplate=true where datname='template_utf8';" | psql + +Then create the databases: + + createdb -T template_utf8 -O foi foi_production + createdb -T template_utf8 -O foi foi_test + createdb -T template_utf8 -O foi foi_development ### Clone Alaveteli -- cgit v1.2.3 From 3cd30c9952f9d174ff4b774b43659900f1d444d8 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 25 Jun 2014 11:43:00 +0100 Subject: Use alaveteli_ as database prefix rather than foi_ Clearer what app the database belongs to --- docs/installing/macos.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/installing/macos.md') diff --git a/docs/installing/macos.md b/docs/installing/macos.md index bdb4c90d8..e93ea452f 100644 --- a/docs/installing/macos.md +++ b/docs/installing/macos.md @@ -106,9 +106,9 @@ We'll create a template for our Alaveteli databases: Then create the databases: - createdb -T template_utf8 -O foi foi_production - createdb -T template_utf8 -O foi foi_test - createdb -T template_utf8 -O foi foi_development + createdb -T template_utf8 -O foi alaveteli_production + createdb -T template_utf8 -O foi alaveteli_test + createdb -T template_utf8 -O foi alaveteli_development ### Clone Alaveteli -- cgit v1.2.3 From 60f3b6b882baecb679896a184561b1fe318e66c3 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 2 Mar 2015 15:42:22 +0000 Subject: Remove obsolete instructions for not getting vendored rails. --- docs/installing/macos.md | 7 ------- 1 file changed, 7 deletions(-) (limited to 'docs/installing/macos.md') diff --git a/docs/installing/macos.md b/docs/installing/macos.md index e93ea452f..c54664896 100644 --- a/docs/installing/macos.md +++ b/docs/installing/macos.md @@ -112,18 +112,11 @@ Then create the databases: ### Clone Alaveteli -We don't want to vendor Rails, as it causes problems locally. - git clone https://github.com/mysociety/alaveteli.git cd alaveteli git submodule init - - sed -i~ 's/\\[submodule "vendor\/rails"\\]//' .git/config - - sed -i~ 's/url = git:\/\/github.com\/rails\/rails.git//' .git/config git submodule update -**Note:** Due to Markdown bugs, the first `sed` command above does not display properly if it appears in blockquote. ### Configure Alaveteli -- cgit v1.2.3 From 8d772f4e27668939493c36a764080e0ccfc2f6d7 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 2 Mar 2015 15:52:39 +0000 Subject: Upgrade rubygems - this is the version we're currently using in travis. --- docs/installing/macos.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/macos.md') diff --git a/docs/installing/macos.md b/docs/installing/macos.md index e93ea452f..9961bcc20 100644 --- a/docs/installing/macos.md +++ b/docs/installing/macos.md @@ -71,7 +71,7 @@ Read `rvm notes` and `rvm requirements` carefully for further instructions. Then The `mahoro` and `pg` gems require special installation commands. Rubygems must be downgraded to 1.6.2 to avoid deprecation warnings when running tests. rvm 1.8.7 - gem update --system 1.6.2 + gem update --system 2.1.11 gem install mahoro -- --with-ldflags="-L/usr/local/Cellar/libmagic/5.09/lib" --with-cppflags="-I/usr/local/Cellar/libmagic/5.09/include" env ARCHFLAGS="-arch x86_64" gem install pg -- cgit v1.2.3 From 30ce21330336abc292018506cff3173669f10bef Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 2 Mar 2015 16:00:00 +0000 Subject: Add a better note for new postgres users. Closes #2199. --- docs/installing/macos.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/installing/macos.md') diff --git a/docs/installing/macos.md b/docs/installing/macos.md index e93ea452f..68f767b2b 100644 --- a/docs/installing/macos.md +++ b/docs/installing/macos.md @@ -96,8 +96,9 @@ Create a `foi` user from the command line, like this: createuser -s -P foi -_Note:_ Leaving the password blank will cause great confusion if you're new to -PostgreSQL. +_Note:_ After running this command you will be prompted to set a +password for the user. Don't leave it blank if you are new to +PostgreSQL, or it could be difficult to set later for you. We'll create a template for our Alaveteli databases: -- cgit v1.2.3