Skip to content

Commit 2f9dc57

Browse files
author
symfony-flex-server[bot]
authored
Merge pull request #900
2 parents 43bdac2 + 0d5ad80 commit 2f9dc57

File tree

7 files changed

+102
-0
lines changed

7 files changed

+102
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
doctrine:
2+
dbal:
3+
override_url: true
4+
url: '%env(resolve:DATABASE_URL)%'
5+
6+
# IMPORTANT: You MUST configure your server version,
7+
# either here or in the DATABASE_URL env var (see .env file)
8+
#server_version: '13'
9+
orm:
10+
auto_generate_proxy_classes: true
11+
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
12+
auto_mapping: true
13+
mappings:
14+
App:
15+
is_bundle: false
16+
type: annotation
17+
dir: '%kernel.project_dir%/src/Entity'
18+
prefix: 'App\Entity'
19+
alias: App
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
doctrine:
2+
orm:
3+
auto_generate_proxy_classes: false
4+
metadata_cache_driver:
5+
type: pool
6+
pool: doctrine.system_cache_pool
7+
query_cache_driver:
8+
type: pool
9+
pool: doctrine.system_cache_pool
10+
result_cache_driver:
11+
type: pool
12+
pool: doctrine.result_cache_pool
13+
14+
framework:
15+
cache:
16+
pools:
17+
doctrine.result_cache_pool:
18+
adapter: cache.app
19+
doctrine.system_cache_pool:
20+
adapter: cache.system
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#doctrine:
2+
# dbal:
3+
# # Overrides the database name in the test environment only
4+
# # "host", "port", "username", & "password" can also be set to override their respective url parts
5+
# #
6+
# # If you're using ParaTest, "TEST_TOKEN" is set by ParaTest otherwise nothing is appended to the database name.
7+
# dbname: main_test%env(default::TEST_TOKEN)%
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"bundles": {
3+
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/",
7+
"src/": "%SRC_DIR%/"
8+
},
9+
"env": {
10+
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
11+
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
12+
"#3": "",
13+
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
14+
"#5": "DATABASE_URL=\"mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7\"",
15+
"DATABASE_URL": "postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
16+
},
17+
"dockerfile": [
18+
"RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \\",
19+
"\tdocker-php-ext-install -j$(nproc) pdo_pgsql; \\",
20+
"\tapk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \\",
21+
"\tapk del .pgsql-deps"
22+
],
23+
"docker-compose": {
24+
"docker-compose.yml": {
25+
"services": [
26+
"database:",
27+
" image: postgres:${POSTGRES_VERSION:-13}-alpine",
28+
" environment:",
29+
" POSTGRES_DB: ${POSTGRES_DB:-app}",
30+
" # You should definitely change the password in production",
31+
" POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}",
32+
" POSTGRES_USER: ${POSTGRES_USER:-symfony}",
33+
" volumes:",
34+
" - db-data:/var/lib/postgresql/data:rw",
35+
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
36+
" # - ./docker/db/data:/var/lib/postgresql/data:rw"
37+
],
38+
"volumes": ["db-data:"]
39+
},
40+
"docker-compose.override.yml": {
41+
"services": [
42+
"database:",
43+
" ports:",
44+
" - \"5432\""
45+
]
46+
}
47+
}
48+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<bg=blue;fg=white> </>
2+
<bg=blue;fg=white> Database Configuration </>
3+
<bg=blue;fg=white> </>
4+
5+
* Modify your DATABASE_URL config in <fg=green>.env</>
6+
7+
* Configure the <fg=green>driver</> (postgresql) and
8+
<fg=green>server_version</> (13) in <fg=green>config/packages/doctrine.yaml</>

doctrine/doctrine-bundle/2.3/src/Entity/.gitignore

Whitespace-only changes.

doctrine/doctrine-bundle/2.3/src/Repository/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)