Skip to content

Commit

Permalink
Update DB_MIGRATION.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nya-elimu authored Jun 19, 2024
1 parent 63e4b25 commit 01489e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DB_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

By using the Java Persistence API (JPA), classed annotated by @Entity (in the [`model`](src/main/java/ai/elimu/model) package) get mapped automatically to database tables/columns: [`src/main/resources/META-INF/jpa-persistence.xml`](https://github.com/elimu-ai/webapp/blob/main/src/main/resources/META-INF/jpa-persistence.xml)

However, when _deleting, modifying or renaming_ an entity class/attribute, we have to manually update the underlying database structure.
> [!IMPORTANT]
> However, when _deleting, modifying or renaming_ an entity class/attribute, we have to manually update the underlying database structure.
## Migration Scripts

Expand All @@ -27,4 +28,5 @@ For an example of a previous database migration script, see https://github.com/e

## Caveats 😅

Note that DB migration performed automatically by the ORM provider (Hibernate), e.g. when adding a new property to an @Entity, is executed _before_ our custom migration scripts.
> [!WARNING]
> Note that DB migration performed automatically by the ORM provider (Hibernate), e.g. when adding a new property to an `@Entity`, is executed _before_ our custom migration scripts.

0 comments on commit 01489e2

Please sign in to comment.