--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/pleroma/templates/setup_db.psql.j2 Thu Aug 16 20:25:56 2018 -0500
@@ -0,0 +1,9 @@
+CREATE USER {{pleroma_user}} WITH ENCRYPTED PASSWORD '{{pleroma_db_passwd}}' CREATEDB;
+-- in case someone runs this second time accidentally
+ALTER USER {{pleroma_user}} WITH ENCRYPTED PASSWORD '{{pleroma_db_passwd}}' CREATEDB;
+CREATE DATABASE {{pleroma_user}};
+ALTER DATABASE {{pleroma_user}} OWNER TO {{pleroma_user}};
+\c {{pleroma_user}};
+--Extensions made by ecto.migrate that need superuser access
+CREATE EXTENSION IF NOT EXISTS citext;
+CREATE EXTENSION IF NOT EXISTS pg_trgm;