Skip to content

Commit 7696ade

Browse files
committed
Switch to Postgres
1 parent cd96905 commit 7696ade

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ parameters:
88
doctrine:
99
dbal:
1010
# configure these for your database server
11-
driver: 'pdo_mysql'
12-
server_version: '5.7'
13-
charset: utf8mb4
14-
default_table_options:
15-
charset: utf8mb4
16-
collate: utf8mb4_unicode_ci
11+
driver: 'pdo_pgsql'
12+
server_version: '11'
1713

1814
url: '%env(resolve:DATABASE_URL)%'
1915
orm:

doctrine/doctrine-bundle/1.6/manifest.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@
1010
"#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
1111
"#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"",
1212
"#3": "Configure your db driver and server_version in config/packages/doctrine.yaml",
13-
"DATABASE_URL": "mysql://symfony:password@db:3306/symfony?charset=utf8mb4&serverVersion=5.7"
13+
"DATABASE_URL": "postgres://symfony:!ChangeMe!@db/symfony?serverVersion=11"
1414
},
15-
"dockerfile": ["RUN docker-php-ext-install pdo_mysql"],
15+
"dockerfile": [
16+
"RUN apk add --no-cache postgresql-dev && \\",
17+
"\tdocker-php-ext-install pdo pdo_pgsql && \\",
18+
"\tapk del postgresql-dev"
19+
],
1620
"docker-compose": {
1721
"services": [
1822
"db:",
19-
" image: mariadb:10.3",
23+
" image: postgres:11-alpine",
2024
" environment:",
21-
" - MYSQL_DATABASE=symfony",
25+
" - POSTGRES_DB=symfony",
26+
" - POSTGRES_USER=symfony",
2227
" # You should definitely change the password in production",
23-
" - MYSQL_PASSWORD=password",
24-
" - MYSQL_RANDOM_ROOT_PASSWORD=true",
25-
" - MYSQL_USER=symfony",
28+
" - POSTGRES_PASSWORD=!ChangeMe!",
2629
" volumes:",
27-
" - db-data:/var/lib/mysql:rw",
30+
" - db-data:/var/lib/postgresql/data:rw",
2831
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
29-
" # - ./docker/db/data:/var/lib/mysql:rw"
32+
" # - ./docker/db/data:/var/lib/postgresql/data:rw",
33+
" ports:",
34+
" - \"5432:5432\""
3035
],
3136
"volumes": ["db-data: {}"]
3237
}

0 commit comments

Comments
 (0)