<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst" -->

---
title: Day 8/30 — Migrations, Not Magic | daily.dev
description: Using TypeORM&#x27;s `synchronize: true` is risky in production because it auto-applies schema changes without review. Safe database migrations should be...
canonical: https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Day 8/30 — Migrations, Not Magic | daily.dev
og:description: Using TypeORM&#x27;s `synchronize: true` is risky in production because it auto-applies schema changes without review. Safe database migrations should be...
og:url: https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst
og:image: https://api.daily.dev/og/posts/GvNRSavst.png
og:image:alt: Day 8/30 — Migrations, Not Magic
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Day 8/30 — Migrations, Not Magic

**[Nestjs Developers](https://daily.dev/sources/nestjsdevs)** · [@ezilemdodana](https://daily.dev/ezilemdodana) · 1 min read · 14 upvotes · 5 comments

## Summary

Using TypeORM's `synchronize: true` is risky in production because it auto-applies schema changes without review. Safe database migrations should be reviewable, repeatable, and environment-agnostic. A zero-downtime approach involves adding columns before code depends on them, keeping changes backward compatible, backfilling large datasets separately, and only removing old columns after old code is fully retired. A successful migration does not guarantee a safe deployment.

## Content

`synchronize: true` is convenient until production data matters.

Production schema changes need migrations that are reviewable, repeatable and deployable across environments.

A safe approach also considers the rollout:

- Add columns before code depends on them
- Keep changes backward compatible
- Backfill large datasets separately
- Remove old columns after old code is gone

A migration running successfully does not automatically mean the deployment is safe.

How do you handle zero-downtime database changes?

#NestJS #TypeORM #DatabaseMigrations

## Community discussion

Top comments from developers on daily.dev.

**@navyaak** · 2 upvotes

> Commit 1:
>
> Add new nullable column
>
> Commit 2:
>
> Application uses new column
>
> Commit 3:
>
> Remove old column
>
> If Commit 2 has a problem, you can roll back the application code while leaving the new column in place. That's usually safe.

**@akhlaqurrahmanomi** · 1 upvotes

> I mostly prefer Prisma with NestJS for better migration-related stuffs.

**@sachchidanand** · 1 upvotes

> Data migration is crucial not just in production but also for staging

## Similar posts on daily.dev

- [Zero-Downtime Postgres Migrations: A 2026 Developer Guide](https://daily.dev/posts/zero-downtime-postgres-migrations-a-2026-developer-guide-drbnzykbh) · Alex CloudStar · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#nodejs](https://daily.dev/tags/nodejs), [#nestjs](https://daily.dev/tags/nestjs)

[View this post on daily.dev](https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst","headline":"Day 8/30 — Migrations, Not Magic","text":"Using TypeORM's `synchronize: true` is risky in production because it auto-applies schema changes without review. Safe database migrations should be reviewable, repeatable, and environment-agnostic. A zero-downtime approach involves adding columns before code depends on them, keeping changes backward compatible, backfilling large datasets separately, and only removing old columns after old code is fully retired. A successful migration does not guarantee a safe deployment.","url":"https://daily.dev/posts/day-8-30-migrations-not-magic-gvnrsavst","datePublished":"2026-08-04T06:29:23.593Z","dateModified":"2026-08-04T06:29:39.258Z","author":{"@type":"Person","name":"Ezile Mdodana","url":"https://daily.dev/ezilemdodana","image":"https://media.daily.dev/image/upload/s--1OI8gwnO--/f_auto/v1771923757/avatars/avatar_7vB9SeLRKhOHGnzEpmFvQ?_a=BAMAMiiu0","description":"Software Project Lead sharing practical insights on NestJS, Angular, AWS and scalable systems.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":8430}},"image":"https://media.daily.dev/image/upload/s--iP5Ir6x3--/f_auto/v1785824964/posts/GvNRSavst?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":14},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":5}],"comment":[{"@type":"Comment","text":"Commit 1:\nAdd new nullable column\nCommit 2:\nApplication uses new column\nCommit 3:\nRemove old column\nIf Commit 2 has a problem, you can roll back the application code while leaving the new column in place. That’s usually safe.","datePublished":"2026-08-09T10:10:39.541Z","url":"https://daily.dev/posts/GvNRSavst#c-6PCys7ue7","author":{"@type":"Person","name":"navya","url":"https://daily.dev/navyaak","image":"https://media.daily.dev/image/upload/s--vM6dTj_h--/f_auto/v1788852968/avatars/avatar_DLRmpRw88MjNBUKqs8T0W?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"I mostly prefer Prisma with NestJS for better migration-related stuffs.","datePublished":"2026-08-10T03:38:26.128Z","url":"https://daily.dev/posts/GvNRSavst#c-Czxpa6Bee","author":{"@type":"Person","name":"Akhlaqur Rahman Omi","url":"https://daily.dev/akhlaqurrahmanomi","image":"https://lh3.googleusercontent.com/a/ACg8ocI1dnma6L1Di5ZW8C5WpjM5mpj16Hu409UEFxjQ6I3EyWSqcgYv=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Data migration is crucial not just in production but also for staging","datePublished":"2026-08-07T05:57:15.663Z","url":"https://daily.dev/posts/GvNRSavst#c-aDopsJfux","author":{"@type":"Person","name":"Sachchidanand Chitnis","url":"https://daily.dev/sachchidanand","image":"https://media.daily.dev/image/upload/s--QUfblGFP--/f_auto/v1782972312/avatars/avatar_1EhzrM1K8RjvlbJPwRfP6?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/nestjsdevs","name":"Nestjs Developers"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nestjs Developers","item":"https://daily.dev/squads/nestjsdevs"},{"@type":"ListItem","position":3,"name":"Day 8/30 — Migrations, Not Magic"}]}
```

