Skip to content

Commit 3438fca

Browse files
committed
feat: switch to Postgres
1 parent 2b55c4f commit 3438fca

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

doctrine/doctrine-bundle/1.6/manifest.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,32 @@
99
"env": {
1010
"#1": "Format described at https://www.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\"",
12-
"#3": "For a PostgreSQL database, use: \"postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8\"",
13-
"#4": "For the Docker integration, use: \"mysql://symfony:ChangeMe@db:3306/app?serverVersion=mariadb-10.5.6\"",
12+
"#3": "For a MySQL database, use: \"mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7\"",
1413
"#5": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
15-
"DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
14+
"DATABASE_URL": "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
1615
},
17-
"dockerfile": ["RUN docker-php-ext-install pdo_mysql"],
16+
"dockerfile": [
17+
"RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \\",
18+
"\tdocker-php-ext-install -j$(nproc) pdo_pgsql; \\",
19+
"\tapk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \\",
20+
"\tapk del .pgsql-deps"
21+
],
1822
"docker-compose": {
1923
"services": [
2024
"db:",
21-
" image: mariadb:${MARIADB_VERSION:-10.5.6}",
25+
" image: postgres:${POSTGRES_VERSION:-13}-alpine",
2226
" environment:",
23-
" MYSQL_DATABASE: ${MYSQL_DATABASE:-app}",
27+
" POSTGRES_DB: ${POSTGRES_DB:-app}",
2428
" # You should definitely change the password in production",
25-
" MYSQL_PASSWORD: ${MYSQL_PASSWORD:-ChangeMe}",
26-
" MYSQL_RANDOM_ROOT_PASSWORD: \"true\"",
27-
" MYSQL_USER: ${MYSQL_USER:-symfony}",
29+
" POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}",
30+
" POSTGRES_USER: ${POSTGRES_USER:-symfony}",
2831
" volumes:",
29-
" - db-data:/var/lib/mysql:rw",
32+
" - db-data:/var/lib/postgresql/data:rw",
3033
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
31-
" # - ./docker/db/data:/var/lib/mysql:rw",
34+
" # - ./docker/db/data:/var/lib/postgresql/data:rw",
3235
" # To expose the port on the host",
3336
" # ports:",
34-
" # - \"3306\""
37+
" # - \"5432\""
3538
],
3639
"volumes": ["db-data:"]
3740
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ doctrine:
44

55
# IMPORTANT: You MUST configure your server version,
66
# either here or in the DATABASE_URL env var (see .env file)
7-
#server_version: '5.7'
7+
#server_version: '13'
88
orm:
99
auto_generate_proxy_classes: true
1010
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware

0 commit comments

Comments
 (0)