Create specific user for DB that will later interact with Symfony
MariaDB [(none)]> create user 'app_user'@'localhost' identified by 'app_user';
Grant privileges
MariaDB [(none)]> grant all privileges on app.* to 'app_user'@'localhost';
Test connection
user@debian:~$ mysql -u app_user -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.11.11-MariaDB-0+deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select current_user();
+--------------------+
| current_user() |
+--------------------+
| app_user@localhost |
+--------------------+
1 row in set (0.001 sec)
If followed steps as listed above, generate migration files from current entity mappings first
user@debian:~/projects/sylius_testing$ php bin/console doctrine:migrations:diff
Generated new migration class to "/home/user/projects/sylius_testing/migrations/Version20250523185138.php"
To run just this migration for testing purposes, you can use migrations:execute --up "DoctrineMigrations\\Version20250523185138"
To revert the migration you can use migrations:execute --down "DoctrineMigrations\\Version20250523185138"
Run migration
user@debian:~/projects/sylius_testing$ php bin/console doctrine:migrations:migrate
WARNING! You are about to execute a migration in database "app" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
>
[notice] Migrating up to DoctrineMigrations\Version20250523185138
[notice] finished in 34.7ms, used 24M memory, 1 migrations executed, 1 sql queries
[OK] Successfully migrated to version: DoctrineMigrations\Version20250523185138