You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/v6/installation/doctrine-orm.md
+24-14Lines changed: 24 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,10 @@ We do not cover the creation steps of the database itself.
5
5
6
6
## Setup database
7
7
8
-
Create a new MySQL database and set its collation to `utf8mb4_general_ci`.
8
+
Create a new **MariaDB**/**MySQL** database and set its collation to `utf8mb4_general_ci`.
9
9
10
10
Make sure you fill out the database credentials in `config/autoload/local.php` under `$databases['default']`.
11
-
Below is the item you need to focus on.
12
-
13
-
> `my_database`, `my_user`, `my_password` are provided only as an example.
11
+
Below is the item you need to focus on:
14
12
15
13
```php
16
14
$databases = [
@@ -28,41 +26,53 @@ $databases = [
28
26
];
29
27
```
30
28
31
-
## Running migrations
29
+
> `my_database`, `my_user`, `my_password` are provided only as an example.
30
+
31
+
### Creating migrations
32
+
33
+
Create a database migration by executing the following command:
34
+
35
+
```shell
36
+
php ./vendor/bin/doctrine-migrations diff
37
+
```
38
+
39
+
The new migration file will be placed in `src/Core/src/App/src/Migration/`.
32
40
33
-
Run the database migrations by using the following command:
41
+
### Running migrations
42
+
43
+
Run the database migrations by executing the following command:
34
44
35
45
```shell
36
46
php ./vendor/bin/doctrine-migrations migrate
37
47
```
38
48
39
-
> If you have already run the migrations, you may get this message.
40
-
> You should double-check to make sure the new migrations are ok to run.
49
+
> If you have already run the migrations, you may get the below message:
41
50
42
51
```text
43
52
WARNING! You have x previously executed migrations in the database that are not registered migrations.
44
53
{migration list}
45
54
Are you sure you wish to continue? (y/n)
46
55
```
47
56
48
-
When using an empty database, you will get this confirmation message instead.
57
+
> In this case, you should double-check to make sure the new migrations are ok to run.
58
+
59
+
When using an empty database, you will get this confirmation message:
49
60
50
61
```text
51
62
WARNING! You are about to execute a migration in database "<your_database_name>" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no)
52
63
```
53
64
54
-
Again, submit `y` to run all the migrations in chronological order.
65
+
Hit `Enter` to confirm the operation.
66
+
This will run all the migrations in chronological order.
55
67
Each migration will be logged in the `migrations` table to prevent running the same migration more than once, which is often not desirable.
56
68
57
69
If everything ran correctly, you will get this confirmation.
58
70
59
71
```text
60
-
[OK] Successfully migrated to version: Core\App\Migration\Version20250407142911
72
+
[OK] Successfully migrated to version: Core\App\Migration\VersionYYYYMMDDHHMMSS
61
73
```
62
74
63
-
> The migration name `Version20250407142911` may differ in future Admin updates.
64
-
65
-
## Fixtures
75
+
### Fixtures
66
76
67
77
Run this command to populate the admin tables with the default values:
0 commit comments