Context

Found .sql files inside db/migrations directory of an unfamiliar repo.

What I Learned

DB Migration = “Database migrations are a way to manage incremental, reversible changes to a database schema.”

개념의미
Schema evolutionDB 구조가 시간에 따라 변화
Migration script변경을 정의한 SQL
Versioning변경 순서를 관리
Migration history어떤 migration이 적용됐는지 기록
Reproducibility다른 환경에서 동일하게 재현

Note

DB structure evolves as the service goes on. Management with DB migration is essential for safety, data integrity, collaboration, environment control, reproducing DB env, rollback, cicd, etc.

우리 서비스도 이제 ByteBase 를 도입했으니 이걸 제대로 활용하는 방법을 익혀봐야겠다

← All TIL