Skip to content

Commit 04dd4cf

Browse files
committed
remove migrations related content
Signed-off-by: Howriq <[email protected]>
1 parent 33ad53c commit 04dd4cf

File tree

3 files changed

+10
-59
lines changed

3 files changed

+10
-59
lines changed

docs/book/v1/chapter-1.md

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ return [
7777
];
7878
```
7979

80-
### Declare the Doctrine Drivers and Migrations Location
80+
### Declare the Doctrine Drivers
8181

8282
With the very nice utility of the package `laminas/laminas-config-aggregator` we can declare our doctrine settings in the `src/App/src/ConfigProvider.php` file.
8383
This package takes all the provided configs from the `config/config.php` file and merges them into one.
@@ -132,12 +132,12 @@ private function getDoctrineConfig(): array
132132
],
133133
'configuration' => [
134134
'orm_default' => [
135-
'result_cache' => 'filesystem',
136-
'metadata_cache' => 'filesystem',
137-
'query_cache' => 'filesystem',
138-
'hydration_cache' => 'array',
139-
'typed_field_mapper' => null,
140-
'second_level_cache' => [
135+
'result_cache' => 'filesystem',
136+
'metadata_cache' => 'filesystem',
137+
'query_cache' => 'filesystem',
138+
'hydration_cache' => 'array',
139+
'typed_field_mapper' => null,
140+
'second_level_cache' => [
141141
'enabled' => true,
142142
'default_lifetime' => 3600,
143143
'default_lock_lifetime' => 60,
@@ -153,47 +153,13 @@ private function getDoctrineConfig(): array
153153
'class' => MappingDriverChain::class,
154154
],
155155
],
156-
'migrations' => [
157-
// Modify this line based on where you would like to have you migrations
158-
'migrations_paths' => [
159-
'Migrations' => 'src/Migrations',
160-
],
161-
'all_or_nothing' => true,
162-
'check_database_platform' => true,
163-
],
164156
'types' => [
165157
UuidType::NAME => UuidType::class,
166158
],
167159
];
168160
}
169161
```
170162

171-
We also require a new file `config/cli-config.php`.
172-
It initializes and returns a `DependencyFactory` that Doctrine Migrations uses to run migrations.
173-
174-
![cli-config](images/cli-config.png)
175-
176-
```php
177-
<?php
178-
179-
declare(strict_types=1);
180-
181-
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
182-
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
183-
use Doctrine\Migrations\DependencyFactory;
184-
use Doctrine\ORM\EntityManager;
185-
186-
$container = require 'config/container.php';
187-
188-
$entityManager = $container->get(EntityManager::class);
189-
$entityManager->getEventManager();
190-
191-
return DependencyFactory::fromEntityManager(
192-
new ConfigurationArray($container->get('config')['doctrine']['migrations']),
193-
new ExistingEntityManager($entityManager)
194-
);
195-
```
196-
197163
## Running doctrine
198164

199165
Now that everything has been configured we only need to do one last thing, to create an executable for the Doctrine CLI.
@@ -221,22 +187,6 @@ $entityManager->getEventManager();
221187
ConsoleRunner::run(new SingleManagerProvider($entityManager));
222188
```
223189

224-
(Optional) To keep things tidy, we recommend making an executable for the migrations of Doctrine as well.
225-
For this, we create `doctrine-migrations` file inside the application's `bin` directory:
226-
227-
![doctrine-migrations](images/doctrine-migrations.png)
228-
229-
```php
230-
#!/usr/bin/env php
231-
<?php
232-
233-
declare(strict_types=1);
234-
235-
namespace Doctrine\Migrations;
236-
237-
require __DIR__ . '/../vendor/doctrine/migrations/bin/doctrine-migrations.php';
238-
```
239-
240190
Now by running the command bellow we should see the Doctrine CLI version alongside its available commands:
241191

242192
```shell
-5.86 KB
Loading

docs/book/v1/introduction.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
For the upcoming tutorial steps we assume that you already have installed the following:
44

55
- A UNIX-based development environment.
6-
If not, we recommend [AlmaLinux](https://almalinux.org/) in a WSL2 container
6+
If not, we recommend [AlmaLinux](https://almalinux.org/) in a WSL2 container.
7+
You can check our [guide](https://docs.dotkernel.org/development/v2/setup/installation/) for setting up you container.
78
- A recent IDE, for example [PhpStorm](https://www.jetbrains.com/phpstorm/) or [VSCode](https://code.visualstudio.com/)
89
- A fresh installation of [Dotkernel Light](https://github.com/dotkernel/light)
910
- Default UTF-8 encoding for files and LF type line separator
1011

11-
For any further tips related to the development environment we suggest that you check out our [development documentation](https://docs.dotkernel.org/development/v2/setup/installation/).
12+
Feel free to check out our [development documentation](https://docs.dotkernel.org/development/v2/setup/installation/) in case of any further questions.

0 commit comments

Comments
 (0)