-
Notifications
You must be signed in to change notification settings - Fork 54
Schema migrations
Bacluc edited this page May 20, 2023
·
1 revision
If you change the Schema of the Database (add or remove a field of an Entity), you also need to add schema migration.
- Make sure the api and the database is running on your local machine.
docker compose up -d
- Generate the migrations with
docker compose exec php bin/console doctrine:migrations:diff
- Modify the generated migration:
- Describe what your migration does in
getDescription()
- Modify the up migration if you need to do something manually (like migrating data into the changed schema). If you do something manually, delete the comment that it was auto generated.
- Modify the down migration. The down migration should reverse the up migration. At least delete the
$this->addSql('CREATE SCHEMA public');
.
- Describe what your migration does in
- Execute your migration with
docker compose exec php bin/console doctrine:migrations:migrate
- Validate that the schema is up to date with:
docker compose exec php bin/console doctrine:schema:validate
- Home
- Installation
- Domain Object Model
- API
- Design
- Localization and translations
- Architecture
-
Testing guide
- API testing (TBD)
- Frontend testing
- E2E testing (TBD)
- Deployment
- Debugging