Skip to content

Commit c5e21fd

Browse files
committed
Issue #133: Added instructions to create migration
Signed-off-by: alexmerlin <[email protected]>
1 parent 22e7d3e commit c5e21fd

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

docs/book/v6/installation/doctrine-orm.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,31 @@
22

33
## Setup database
44

5-
Make sure you fill out the database credentials in `config/autoload/local.php` under `$databases['default']`.
5+
Use an existing empty one or create a new **MariaDB**/**MySQL** database.
66

7-
Create a new MySQL database - set collation to `utf8mb4_general_ci`
7+
> Recommended collation: `utf8mb4_general_ci`.
88
9-
## Running migrations
9+
With a database created, fill out the database connection params in `config/autoload/local.php` under `$databases['default']`.
1010

11-
Run the database migrations by using the following command:
11+
#### Creating migrations
12+
13+
Create a new migration by running:
14+
15+
```shell
16+
php ./vendor/bin/doctrine-migrations diff
17+
```
18+
19+
The new migration file will be placed in `src/Core/src/App/src/Migration/`.
20+
21+
#### Running migrations
22+
23+
Execute a new migration by running:
1224

1325
```shell
14-
php vendor/bin/doctrine-migrations migrate
26+
php ./vendor/bin/doctrine-migrations migrate
1527
```
1628

17-
This command will prompt you to confirm that you want to run it.
29+
This command will prompt you to confirm that you want to run it:
1830

1931
> WARNING! You are about to execute a migration in database "..." that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
2032
@@ -27,21 +39,21 @@ Hit `Enter` to confirm the operation.
2739
To list all the fixtures, run:
2840

2941
```shell
30-
php bin/doctrine fixtures:list
42+
php ./bin/doctrine fixtures:list
3143
```
3244

3345
This will output all the fixtures in the order of execution.
3446

3547
To execute all fixtures, run:
3648

3749
```shell
38-
php bin/doctrine fixtures:execute
50+
php ./bin/doctrine fixtures:execute
3951
```
4052

4153
To execute a specific fixture, run:
4254

4355
```shell
44-
php bin/doctrine fixtures:execute --class=FixtureClassName
56+
php ./bin/doctrine fixtures:execute --class=FixtureClassName
4557
```
4658

4759
More details on how fixtures work can be found on [dot-data-fixtures documentation](https://github.com/dotkernel/dot-data-fixtures#creating-fixtures)

0 commit comments

Comments
 (0)