Repository: saleor/saleor
Pull request: Add createdb note to getting started for Windows
I want to merge this change because it fixes #2680 

### Pull Request Checklist

<!-- Please keep this section. It will make maintainer's life easier. -->

1. [ ] Privileged views and APIs are guarded by proper permission checks.
1. [ ] All visible strings are translated with proper context.
1. [ ] All data-formatting is locale-aware (dates, numbers, and so on).
1. [ ] Database queries are optimized and the number of queries is constant.
1. [ ] The changes are tested.
1. [ ] The code is documented (docstrings, project documentation).
1. [ ] GraphQL schema and type definitions are up to date.


Problem statement:
Update Windows installation guide
In windows installation guide we've missed a point, stating that database should be created. Something like:

```
Create a PostgreSQL database:

Unless configured otherwise the store will use saleor as the database name.

   $ createdb saleor
```

However, this information is present for both Mac and Linux

Hints from issue discussion:
Windows docs tell the user to create a SUPERUSER so that Django can create the DB for itself.
@patrys does it?

On Linux I get `django.db.utils.OperationalError: FATAL:  database "saleor" does not exist`. Maybe a parameter to pass? Or I am missing something?

Edit: looks like there is no such thing in the django migrations source code.
First:
- Django 3.6.6 
- Add environment variable System - Advanced System Settings - System variables: SECRET_KEY = 'yourssecretkey'
- Open settings.py add SECRET_KEY = os.environ.get('SECRET_KEY')
-pgAdmin: create database saleor and saleor user with superuser privilege.
For create database in Postgress need first connect to system database "postgres", then we can create new databases.
so, usual way connect from default postgress user and create saleor database: 
1. open you favorite pgadmin/ems manager/dbForge Studio for PostgreSQL/psql.exe 
2. or use ready Docker image from hub with postgres (have official)
3. or use virtualbox/vagrant/VPS/VDS....

developer must have variants, in any way Docker - mainstream - and this easy and universal way for see "what it is Saleor?"
i use and work fine on windows 10 x64: 
elasticsearch, just get last 5.* version from oficcial site, because what have in docs not present for windows:
elasticsearch-5.6.10

redis, little old, but work perfect:
https://github.com/MicrosoftArchive/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.msi
https://github.com/MicrosoftArchive/redis/releases

p.s. at this moment write little solution for universal send message (from system/user to system/user, use simple backends style: email, inapp, SMS...) based at https://github.com/danidee10/django-notifs use latest RabitMQ (without uwsgi+websockets, but this fix by settings one line on prod).
So live with Windows+Python possible!
> Windows docs tell the user to create a SUPERUSER so that Django can create the DB for itself.

Correct, windows documentation clearly tell us to create a superuser and i guess require no change. 
@Pacu2 Not sure what is the scope of work here?
Following the Windows install docs results in this error after `python manage.py migrate`:

`django.db.utils.OperationalError: FATAL:  database "saleor" does not exist`

Instructions should be added to the Windows docs to say that the user needs to create a database. It is not done automatically for production type deployments.

The required command is something like:

`C:\PostgreSQL\pg10\bin>createdb -U postgres -O saleor saleor`

Commit message: Add createdb note to getting started for Windows

Patch to review:
diff --git a/docs/gettingstarted/installation-windows.rst b/docs/gettingstarted/installation-windows.rst
index db456345624..cee96dc673f 100644
--- a/docs/gettingstarted/installation-windows.rst
+++ b/docs/gettingstarted/installation-windows.rst
@@ -98,6 +98,14 @@ All commands need to be performed in either PowerShell or a Command Shell.
 
    Unless configured otherwise the store will use ``saleor`` as both username and password. Remeber to give your user the ``SUPERUSER`` privilege so it can create databases and database extensions.
 
+#. Create a PostgreSQL database
+
+   See `PostgreSQL's createdb command <https://www.postgresql.org/docs/current/static/app-createdb.html>`_ for details.
+
+   .. note::
+
+       Database name is extracted from the ``DATABASE_URL`` environmental variable. If absent it defaults to ``saleor``.
+
 #. Prepare the database:
 
    .. code-block:: powershell


Code review comments:
diff_hunk: @@ -98,6 +98,14 @@ All commands need to be performed in either PowerShell or a Command Shell.
 
    Unless configured otherwise the store will use ``saleor`` as both username and password. Remeber to give your user the ``SUPERUSER`` privilege so it can create databases and database extensions.
 
+#. Create a PostgreSQL database
+
+   See `PostgreSQL's createdb command <https://www.postgresql.org/docs/current/static/app-createdb.html>`_ for details.
+
+   .. note::
+
+       Database name is extracted from the ``DATABASE_URL`` environmental variable. If absent it defaults to ``saleor``.
path: docs/gettingstarted/installation-windows.rst
text: @user1:
> **The** database name

> the ``DATABASE_URL`` environmental variable

It's an **environment variable**, it's not an ecological variable.

---

Also, I can't really manage to make much sense to the edits. Why not just just taking or basing your changes on the Linux or MacOS docs?

https://github.com/mirumee/saleor/blob/d9467f967cabe365b50e913e004abd22f8c42a94/docs/gettingstarted/installation-macos.rst#L125-L131

@author:
@user1 the text is copy pasted from the Linux page.

@user1:
I really think that just redirecting the user to another documentation, just to very (very) implicitly tell them to do `createdb saleor` is a very bad idea. It will confuse many users and make them give up on the installation has they would have to search the information or simply not get the point.

Also, are the postgres binaries in the Windows' `PATH`? Or does the user has to set it/ tell Windows where to look for `createdb`?

@author:
I don't disagree but this patches a significantly worse issue with the docs and does it quickly without causing problems.