init postgresql db

This commit is contained in:
Tchama 2021-04-17 23:06:23 +02:00
parent 70fc3ca9ab
commit 5622128c68
2 changed files with 7 additions and 1 deletions

View File

@ -36,3 +36,9 @@ Cette branche démarre d'une installation toute prête de la demo Symfony. La db
* `$ mv myproject/* . && mv myproject/.* . && rmdir myproject` * `$ mv myproject/* . && mv myproject/.* . && rmdir myproject`
* `composer require annotations twig orm form form validator maker-bundle security-csrf \ * `composer require annotations twig orm form form validator maker-bundle security-csrf \
&& composer require --dev profiler` && composer require --dev profiler`
* Adapt querystring in `./app/.env`:
```
--- DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
+++ DATABASE_URL="postgresql://postgres:secret@db:5432/postgres?serverVersion=12&charset=utf8"
```
* Create database schema: `bin/console doctrine:schema:create`

View File

@ -24,5 +24,5 @@ APP_SECRET=d6c584c628f4a555632b6e2c1382502a
# #
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7" # DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8" DATABASE_URL="postgresql://postgres:secret@db:5432/postgres?serverVersion=12&charset=utf8"
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###