Learn Why and How to Use Relational Database Migrations by@artemsutulov
681 reads

Learn Why and How to Use Relational Database Migrations

tldt arrow
EN
Read on Terminal Reader🖨️

Too Long; Didn't Read

Introduction When developing backend services, it’s effortless to create problems if database integration is implemented incorrectly. Nowadays, developers mostly use two approaches: Automatic generation, e.g., JPA or Hibernate - database initializes and keeps up to date by comparing classes and the current DB state; if changes are needed, they apply. That means that in Hibernate entity, we add the new column: @Column(name = "receive_notifications", nullable = false) private Boolean receiveNotifications; After starting the app, we see the error in logs and no new column. Each developer requires a separate environment. But it’s better next time to consider migrations because it will relieve Java entities, remove excess responsibility, and benefit you with a lot of control over DDL. You can find the fully working example on GitHub.
featured image - Learn Why and How to Use Relational Database Migrations
Artem Sutulov HackerNoon profile picture

@artemsutulov

Artem Sutulov

Learn More
LEARN MORE ABOUT @ARTEMSUTULOV'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa